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

Add test run id to RootModule #1232

Merged
merged 3 commits into from
Mar 4, 2024
Merged

Add test run id to RootModule #1232

merged 3 commits into from
Mar 4, 2024

Conversation

ankur22
Copy link
Collaborator

@ankur22 ankur22 commented Mar 4, 2024

What?

This adds the test run ID to the RootModule allowing any browser component to work with the test run ID.

Why?

This is a requirement to allow better integration with external tools (such as faro)to be used to label sessions with a test run ID. The test run id will eventually be populated in the window.k6 object which is injected into each and every browserContext and page.

The change localises the retrieval of the test run id in one place instead of having every component need to do a lookup for an env var.

Checklist

  • I have performed a self-review of my code
  • I have added tests for my changes
  • I have commented on my code, particularly in hard-to-understand areas

Related PR(s)/Issue(s)

Updates: https://github.com/grafana/k6-cloud/issues/2066

This will help us keep track of the current test run id and allow
components in the browser module to work with it.
This will read and record the value of K6_CLOUD_PUSH_REF_ID when it is
available and not an empty string. The test run id will be available to
any component that requires it.
@ankur22 ankur22 requested a review from inancgumus March 4, 2024 11:42
Copy link
Member

@inancgumus inancgumus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM so far.

env/env.go Show resolved Hide resolved
browser/module.go Show resolved Hide resolved
@ankur22 ankur22 merged commit 5321e72 into main Mar 4, 2024
17 checks passed
@ankur22 ankur22 deleted the add/test-run-id branch March 4, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants