Skip to content

Enhanced test fixtures for integration tests. - #1834

Merged
jglogan merged 2 commits into
apple:mainfrom
jglogan:clitest-refactor
Jun 26, 2026
Merged

jglogan merged 2 commits into
apple:mainfrom
jglogan:clitest-refactor

Conversation

@jglogan

@jglogan jglogan commented Jun 26, 2026

Copy link
Copy Markdown
Contributor
  • Part of [Request]: Integration tests are fail frequently and are difficult to maintain. #1833.
  • Adds ContainerFixture with scoped resource lifecycle and cleanup in place of implementation inheritance for test support functions. The fixture also handles resource prefixing and uses a more ergonomic CommandResult in place of a tuple for return values.
  • ImageWarmup suite pre-pulls well-known images, and copyWarmupImage() tags test-local refs, keeping the canonical image store untouched.
  • Three-phase integration-new: warmup, followed by concurrent tests (managed by the swift test --experimental-maximum-parallelization-width flag), followed by serialized tests.
  • coverage-new merges unit + integration-new profraw, replacing coverage in CI as a migration progress indicator.
  • Updates GH workflow so non-coverage invokes both the integration and integration-new Makefile targets, while coverage runs invoke the coverage-new target.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Recent CI integration test issues and test time increase, especially after adding container machine tests.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@github-actions github-actions Bot added the ci label Jun 26, 2026
@jglogan
jglogan force-pushed the clitest-refactor branch 3 times, most recently from 705a335 to b92d19b Compare June 26, 2026 02:40
- Adds `ContainerFixture` with scoped resource lifecycle
  and cleanup in place of implementation inheritance for
  test support functions. The fixture also handles
  resource prefixing and uses a more ergonomic
  `CommandResult` in place of a tuple for return values.
- `ImageWarmup` suite pre-pulls well-known images, and
  `copyWarmupImage()` tags test-local refs, keeping the
  canonical image store untouched.
- Three-phase `integration-new`: warmup, followed by
  concurrent tests (managed by the swift test
  `--experimental-maximum-parallelization-width` flag),
  followed by serialized tests.
- `coverage-new` merges unit + integration-new profraw,
  replacing `coverage` in CI as a migration progress
  indicator.
- Updates GH workflow so non-coverage invokes both the
  `integration` and `integration-new` Makefile targets,
  while coverage runs invoke the `coverage-new` target.
@jglogan
jglogan force-pushed the clitest-refactor branch from b92d19b to 529f6c4 Compare June 26, 2026 04:32
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

Code Coverage

Tier Line Coverage
Unit 33.33%
Integration 0.62%
Combined 33.95%

Comment thread Makefile
Comment on lines +213 to +215
echo "Clearing application data under $(APP_ROOT) (preserving kernels)..." ; \
mkdir -p $(APP_ROOT) ; \
find "$(APP_ROOT)" -mindepth 1 -maxdepth 1 ! -name kernels -exec rm -rf {} + ; \

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.

I would prefer we also remove the kernel just so we're guaranteed to have a clean setup.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could add some sort of preserve-kernel env in a follow-up and make the default the slower setup option.

@jglogan
jglogan merged commit 649164d into apple:main Jun 26, 2026
3 checks passed
@jglogan
jglogan deleted the clitest-refactor branch June 26, 2026 19:01
saehejkang pushed a commit to saehejkang/container that referenced this pull request Jul 16, 2026
- Part of apple#1833.
- Adds `ContainerFixture` with scoped resource lifecycle and cleanup in
place of implementation inheritance for test support functions. The
fixture also handles resource prefixing and uses a more ergonomic
`CommandResult` in place of a tuple for return values.
- `ImageWarmup` suite pre-pulls well-known images, and
`copyWarmupImage()` tags test-local refs, keeping the canonical image
store untouched.
- Three-phase `integration-new`: warmup, followed by concurrent tests
(managed by the swift test
`--experimental-maximum-parallelization-width` flag), followed by
serialized tests.
- `coverage-new` merges unit + integration-new profraw, replacing
`coverage` in CI as a migration progress indicator.
- Updates GH workflow so non-coverage invokes both the `integration` and
`integration-new` Makefile targets, while coverage runs invoke the
`coverage-new` target.
jianliang00 pushed a commit to jianliang00/container that referenced this pull request Aug 28, 2026
- Part of apple#1833.
- Adds `ContainerFixture` with scoped resource lifecycle and cleanup in
place of implementation inheritance for test support functions. The
fixture also handles resource prefixing and uses a more ergonomic
`CommandResult` in place of a tuple for return values.
- `ImageWarmup` suite pre-pulls well-known images, and
`copyWarmupImage()` tags test-local refs, keeping the canonical image
store untouched.
- Three-phase `integration-new`: warmup, followed by concurrent tests
(managed by the swift test
`--experimental-maximum-parallelization-width` flag), followed by
serialized tests.
- `coverage-new` merges unit + integration-new profraw, replacing
`coverage` in CI as a migration progress indicator.
- Updates GH workflow so non-coverage invokes both the `integration` and
`integration-new` Makefile targets, while coverage runs invoke the
`coverage-new` target.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Sponsor
SponsoredKunjungi sekarang
Promo