Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Archiver

By default, serial logs (given that the hardware is set up correctly), and the logs from the tests will be sent back to the client that started the test, upon the test finishing. Other artifacts can be sent back to the client using the archiver method.

The Archiver is imported into each test and hence the methods can be accessed within any test. Check test.js to check the imports. To archive a file:

example
    await this.Archiver.add(this.id, "Path/to/file/needs/to/be/archived");

To directly archive the output of a command, example: journalctl or dmesg commands. Use the archiveLogs helper accessible through worker context.

  • @example
    await this.context.get().worker.archiveLogs(title, target, command);

Using this method, at the end of the test, any artifacts added to the archive are compressed and downloaded by the client. These are available in the workspace/reports directory at the end of the test. This can also be helpful when storing artifacts/reports/logs after a test suite run.

Index

Namespaces

Properties

Properties

export=

export=: { add: (id: string, artifactPath: string) => Promise<void>; getStream: (id: string, artifactPath: string) => Promise<WriteStream> }

Type declaration

  • add: (id: string, artifactPath: string) => Promise<void>
      • (id: string, artifactPath: string): Promise<void>
      • Archive a file to be later sent to the client as an artifact.

        Parameters

        • id: string

          The name of the directory in which logs will be archived. Usuallly this value is the name of the test suite (Available in the test using this.id)

        • artifactPath: string

          The absolute path of the file needed to be archived.

        Returns Promise<void>

  • getStream: (id: string, artifactPath: string) => Promise<WriteStream>
      • (id: string, artifactPath: string): Promise<WriteStream>
      • Archive the file as a stream to be later sent to the client as an artifact.

        Parameters

        • id: string

          The name of the directory in which logs will be archived. Usuallly this value is the name of the test suite (Available in the test using this.id)

        • artifactPath: string

          The absolute path of the file needed to be archived.

        Returns Promise<WriteStream>

        stream of the file

Generated using TypeDoc