CI Build ID
Using CI Build ID for reporting to Currents
What is CI Build ID?
CI Build ID is a unique identifier used by Currents to collect test results. Think of it as a hard drive "folder". We call it a Run (see Runs).
For example, when multiple CI machines run tests in parallel, their combined results are combined if they use the same CI Build ID.
results with
--ci-build-id build001
will go tobuild001
"folder"results with
--ci-build-id build002
will go tobuild002
"folder"

Creating a CI Build ID
You can choose between leveraging our auto-detection algorithm, or manually generating a CI Build ID.
Automatic Detection
Currents automatically detects CI Build ID for popular CI providers based on the presence of environment variables. Please refer to Build ID for Popular CI Providers to see the environment variables used for each provider.
Otherwise, if not explicitly provided, Currents generates a random unique id.
Explicit Value
You can also specify CI Build ID explicitly.
With the CLI, you can use the --ci-build-id
flag, for example:
pwc run --ci-build-id CI_BUILD_ID --key xxx --project-id yyy
In order to manually construct a CI Build ID that is unique for each build (but similar across all the parallel machines) it is recommended to use your CI provider's environment variables that combine pipeline/workflow/build identifier and also an attempt number.
For example, for GitHub Actions:
--ci-build-id "${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }}"
Refer to your CI provider documentation for the list of available environment variables.
Examples
Different CI Build ID, Different Builds
Imagine a CI pipeline running tests in parallel using multiple machines. Starting two builds with a different CI Build ID will create 2 distinct "Runs" in Currents dashboard.
The reporting will happen for each build independently from the other. That is usually the desired situation - each build should have a unique CI Build ID.
Same CI Build ID, Different builds
In contrast, consider a situation when 2 different builds use the same CI Build ID. That's an uncommon situation, but it's worth demonstrating for understanding the use of CI Build ID.

We created two different builds with the same CI Build ID. That will result in 6 machines reporting their results to the same run.
Build ID for Popular CI Providers
Currents tries to automatically detect the CI provider by looking at the environment variables and picking the best combination.
Next Steps
Now, after you're familiar with CI Build ID, explore Reporting Strategy to customizing your reporting to Currents.
FAQ
Last updated
Was this helpful?