Skip to content

Simplify correlation of test prefix to test ID. - #2071

Merged
jglogan merged 4 commits into
apple:mainfrom
jglogan:integration-testcorrelation
Aug 5, 2026
Merged

Simplify correlation of test prefix to test ID.#2071
jglogan merged 4 commits into
apple:mainfrom
jglogan:integration-testcorrelation

Conversation

@jglogan

@jglogan jglogan commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
  • At present in the integration tests, it's difficult for humans to look at logs and correlate the test prefix value we use to keep resource names short to the test suite and method.
  • Adds the test name to the log metadata so both are readily at hand.
  • Add test lifecycle messages to ContainerFixture for more accurate timing measurement.

jglogan added 2 commits August 4, 2026 19:21
- At present in the integration tests, it's difficult
  for humans to look at logs and correlate the test
  prefix value we use to keep resource names short
  to the test suite and method.
- Use `clitests/<SuiteName>/<method>.log` for placing
  test log files.
- Adds the test name to the log metadata.
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Code Coverage

Tier Line Coverage
Unit 24.41%
Integration 66.23%
Combined 75.64%

jglogan added 2 commits August 4, 2026 21:23
… work.

Move logger construction ahead of scratch-dir creation so a "test start"
message is the first thing recorded, and log "test end" (pass/fail) right
after the test body closure returns/throws. Makes it possible to bound a
test's actual execution window directly from its own log file.
Bookends the test start/end messages with a third marker once
runCleanup() finishes, so a test's teardown time is visible in its
own log alongside its execution window.
// their concurrently-running cases, so fall back to the per-invocation `testID` to keep
// each case's log file distinct.
let isParameterized = Test.Case.current?.isParameterized ?? false
let logFileName = isParameterized ? "\(testName)-\(testID).log" : "\(testName).log"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can use Test.Case.current?.arguments to append passed argument in log file name.

@jglogan
jglogan merged commit bc50fcb into apple:main Aug 5, 2026
3 checks passed
@jglogan
jglogan deleted the integration-testcorrelation branch August 5, 2026 16:32
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