Skip to content

Add ${EXECUTION ID} automatic variable and --executionid option (#2743) - #5757

Open
JonnasFigueiredo wants to merge 2 commits into
robotframework:masterfrom
JonnasFigueiredo:feature/execution-id
Open

JonnasFigueiredo wants to merge 2 commits into
robotframework:masterfrom
JonnasFigueiredo:feature/execution-id

Conversation

@JonnasFigueiredo

Copy link
Copy Markdown

Implements #2743.

Adds a unique execution ID to each Robot Framework run.

What it does

  • Exposes the ID as the ${EXECUTION ID} automatic variable.
  • Stores it as Execution ID metadata on the top level suite, so it is visible in logs and reports and saved in output.xml (and carried over to rebot generated reports).
  • By default the ID is a random UUID (uuid.uuid4()).
  • Adds a --executionid option to set the ID explicitly, e.g. to share a common ID across parallel executions (pabot) or to use an application specific scheme.
*** Test Cases ***
Example
    Log    Current execution: ${EXECUTION ID}
robot --executionid 20260818-build-42 tests/

Design

This follows the design @pekkaklarck outlined in #2743: generate a UUID, allow overriding it from the command line, add it as top level suite metadata, and expose it as a global variable. Exposing the existing internal test/suite IDs as automatic variables — also proposed in that issue — is intentionally left out of scope and can be handled separately.

An explicit --metadata "Execution ID:..." still takes precedence over the automatically added metadata.

Tests & docs

  • Unit tests for the new setting and execution_id property (utest/conf/test_settings.py).
  • Acceptance test for the variable and the suite metadata (atest/testdata|robot/variables/builtin_variables.robot).
  • User Guide: documented the new ${EXECUTION ID} automatic variable; the --executionid option is documented in --help.

Happy to adjust the variable/metadata naming, the default ID scheme, or the scope based on your feedback.

…tframework#2743)

Generate a unique ID for each execution and make it available as the
`${EXECUTION ID}` automatic variable. The ID is also stored as `Execution ID`
metadata of the top level suite so that it is visible in logs and reports and
saved in the output file.

By default the ID is a random UUID. It can be set explicitly with the new
`--executionid` option, for example to share a common ID across parallel
executions or to use an application specific scheme.

This implements the core of the design outlined in the issue. Exposing the
existing test and suite IDs as automatic variables, also proposed there, is
left out of scope and can be handled separately.
Merge master into feature/execution-id

This branch has not been deployed

No deployments
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.

1 participant