-
Notifications
You must be signed in to change notification settings - Fork 101
[probes] Add BROWSER probe type #942
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- It uses playwright for running browser tests. It expects playwright to be already installed. We'll eventually provide a docker image with playwright installed. - Probe config takes a test spec. Each test can contain multiple tests and steps. We export metrics for all tests defined in the test spec. We achieve this by defining a custom reporter. - Config also takes the output directory for generated test assets like screenshots, and traces (need to be enabled through config). If output directory is not defined, a temporary directory will be created. However, we'll strongly encourage users to provide a persistent directory so that screenshots are preserved. More work here: - Serve screenshots through cloudprober web server, unless disabled. - Implement retention period for assets. Warning: this is not ready for use right now, that's why integrating into a dev branch for now.
- Now that we have factored out command execution part (#854), use that.
- Add a web server to serve test artifacts. Web server serves artifacts at /artifacts/<probename> path by default. You can change the path through config. - Arrange artifacts by date. - Add long term storage options, not implemented yet though.
- Create the abstration of artifacts handler that will be initialized at the time of probe initialization. Artifacts handler in turn will initialize various storage backends based on the configuration. - Probe calls handle() on the artifacts handler in a goroutine after each probe run with the output directory path. Artifacts handler will then upload the artifacts to all the configured storage backends. - Tested with a local minio setup and AWS S3 bucket. - Other changes: enable HTML reporter and persist only reports as these reports provide a good overview and contain all the assets like screenshots, videos and traces.
- To ensure that workdir doesn't grow indefinitely, you can configure cleanup handler that will periodically delete files older than a certain age, e.g. you can run cleanup handler every hour to delete files older than 1 day.
- Factor out common code for walking through artifacts directory and add tests for it. - Add test for local store file saving.
- This adds non-capitalized env variables for playwright: target_name, target_ip, target_port, target_label_<label>. - Also add tests to verify that correct command line is being generated.
- Tested with a GCP account.
- Also add one more test.
- Instead of assuming default playwright installation path to be /playwright, use environment variable $PLAYWRIGHT_DIR and set this variable in our container image.
- Instead of copying test specs to temporary work dir, use them at their original location itself. This will allow tests to refer to other files, etc. - Assume test specs to be located at the same location as config file itself. Provide an option to specify the test directory. For example, one could say all tests are at /tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add BROWSER probe type to Cloudprober.
-pw
tags) or user provided playwright installation.-pw
tag suffix.Example config:
Example test spec (
example.spec.ts
)