Skip to content

junit: record the invocation context as report properties - #1244

Merged
kostyanf14 merged 1 commit into
HCK-CI:masterfrom
jamepark4:junit-record-invocation-properties
Nov 24, 2026
Merged

kostyanf14 merged 1 commit into
HCK-CI:masterfrom
jamepark4:junit-record-invocation-properties

Conversation

@jamepark4

@jamepark4 jamepark4 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

The junit report records what ran (test cases, counts, status) but not what the invocation was asked to run, so per-case invocations that share a suite directory cannot be told apart by report consumers without inferring it from the executed test names.

Record the invocation context as properties:

  • category: the --category value (suite invocations)
  • testcase: the --testcase selection (per-case invocations; each distinct selection identifies one invocation structurally)
  • fmf_node: TMT_TEST_NAME when auto_hck runs as a tmt test child, which carries the originating test path; absent for manual invocations

Nil values are omitted, so the properties only appear when they apply.

Validated by rendering the report through the real JUnit class for the three shapes (per-case under tmt, manual suite, suite under tmt) and asserting the resulting properties.

Summary by CodeRabbit

  • New Features
    • JUnit test reports now include available invocation metadata: the test category, testcase, test name, job ID, and Testing Farm request ID.
    • Metadata fields without values are omitted from the report.
    • Existing project, setup-manager, and engine properties remain included alongside the invocation metadata.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

JUnit run properties now include non-nil category and testcase options and available TMT and Testing Farm environment values. The environment values use the keys fmf_node, tmt_job_id, and testing_farm_request_id.

Changes: JUnit Invocation Properties

Layer / File(s) Summary
Build and merge invocation metadata
lib/junit.rb
invocation_properties returns non-nil category and testcase options, plus available TMT and Testing Farm values under report-specific keys. run_properties merges this metadata with the existing project, setup-manager, and engine properties.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: kostyanf14, bhbhatt

Merge Risk: Minimal · up to ac0b4

This adds invocation metadata (category, testcase, and TMT/Testing Farm identifiers) to JUnit report properties, and values that are absent are omitted. The change is small and additive, with no concrete merge-blocking risk identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "junit: record the invocation context as report properties" matches the main change. The diff adds an invocation_properties method to the JUnit class in lib/junit.rb. It records the test cat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "junit: record the invocation context as report properties" matches the main change. The diff adds an invocation_properties method to the JUnit class in lib/junit.rb. It records the test category, testcase, fmf_node, tmt_job_id, and testing_farm_request_id as report properties, and run_properties merges them in. The title is specific and short. It does not name the TMT or Testing Farm context, but it still describes the primary change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54abdf61-d5e9-4237-949b-d1f750e78485
Commits

Reviewing files that changed from the base of the PR and between 7bc54d7 and ac0b445.

Files selected for processing: 1

  • lib/junit.rb

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread lib/junit.rb Fixed
The junit report records what ran (test cases, counts, status) but not
what the invocation was asked to run, so per-case invocations that
share a suite directory cannot be told apart by report consumers
without inferring it from the executed test names.

Record the invocation context as properties:

- category: the --category value (suite invocations)
- testcase: the --testcase selection (per-case invocations; each
  distinct selection identifies one invocation structurally)
- fmf_node: TMT_TEST_NAME when auto_hck runs as a tmt test child,
  which carries the originating test path; absent for manual
  invocations
- tmt_job_id: TMT_JOB_ID when the environment provides it
- testing_farm_request_id: TESTING_FARM_REQUEST_ID, exported by
  testing-farm to the test environment, so reports can be correlated
  with their request without parsing the whiteboard

Nil values are omitted, so the properties only appear when they apply.

Validated by rendering the report through the real JUnit class for the
invocation shapes (per-case under tmt, manual suite, suite under tmt,
with and without the optional environment variables) and asserting the
resulting properties.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@jamepark4
jamepark4 force-pushed the junit-record-invocation-properties branch from 7bc54d7 to ac0b445 Compare November 20, 2026 17:16
@kostyanf14

Copy link
Copy Markdown
Contributor

ok to test

@kostyanf14
kostyanf14 merged commit bd429d3 into HCK-CI:master Nov 24, 2026
11 of 14 checks passed
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.

3 participants