Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define an interface for local and remote storage #1155

Closed
2 tasks
ankur22 opened this issue Jan 16, 2024 · 1 comment
Closed
2 tasks

Define an interface for local and remote storage #1155

ankur22 opened this issue Jan 16, 2024 · 1 comment
Assignees
Labels
remote remote browser related team/k6browser To distinguish the issue on project boards.

Comments

@ankur22
Copy link
Collaborator

ankur22 commented Jan 16, 2024

What?

Define an interface that exports a persist method, abstracting away how or where the file is being persisted.

Why?

The browser module can take screenshots. These screenshots are currently either:

  1. Persisted to the local disk relative to the k6 binary;
  2. Returned to the user in the test script for them to do something with the binary data.

When a user works with the first option, we want the browser module to either:

  1. persist the file to the local disk;
  2. or upload it to remote location.

The interface needs to be generic enough to allow for both these cases, and it's only exported method should be to persist a blob of data.

How?

Define an interface that takes:

  1. the context;
  2. the file path;
  3. the stream of data.

which will satisfy the requirement of abstracting away the how and where the file is being saved.

It is a good idea to generalise the problem (use io.writer) to a blob of data even though the main use case is to store the screenshots so that we can stream the data either to disk or a remote location.

Tasks

Tasks

Related PR(s)/Issue(s)

Take a look at grafana/k6#3017 for some more guidance.

@ankur22 ankur22 changed the title Implement an interface for local and remote storage Define an interface for local and remote storage Jan 16, 2024
@ankur22 ankur22 added team/k6browser To distinguish the issue on project boards. remote remote browser related labels Jan 16, 2024
@ankur22 ankur22 self-assigned this Jan 25, 2024
@ankur22
Copy link
Collaborator Author

ankur22 commented Jan 31, 2024

The interface implementation work has been moved to #1160.

@ankur22 ankur22 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
remote remote browser related team/k6browser To distinguish the issue on project boards.
Projects
None yet
Development

No branches or pull requests

1 participant