Skip to content

ci: Implement 4-way hash sharding for integration tests#133

Merged
cgwalters merged 3 commits into
bootc-dev:mainfrom
cgwalters:test-matrix
Nov 7, 2025
Merged

ci: Implement 4-way hash sharding for integration tests#133
cgwalters merged 3 commits into
bootc-dev:mainfrom
cgwalters:test-matrix

Conversation

@cgwalters
Copy link
Copy Markdown
Collaborator

Our integration tests are getting slower, and it's a bit hard to avoid because we really do want to do some medium-expensive thing like disk image generation across multiple base images.

Split integration tests across 4 parallel GHA runners using nextest's really cool hash-based sharding.

Assisted-by: Claude Code (Sonnet 4.5)

@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@cgwalters
Copy link
Copy Markdown
Collaborator Author

OK this definitely worked! Cool beans. However, one of the shards took a lot longer than the other, and now it's even more obvious that we have too many tests which are doing libvirt run, so I asked AI to consolidate, and that looked to have worked out well.

@cgwalters
Copy link
Copy Markdown
Collaborator Author

cgwalters commented Nov 6, 2025

Awesome! Got our wall clock down to approx 15m for build and 15m for testing, which is way way way better.

@cgwalters cgwalters enabled auto-merge (rebase) November 6, 2025 15:28
@cgwalters
Copy link
Copy Markdown
Collaborator Author

Hmm though what's a bit annoying here is wiring this up to automerge and required contexts...now we can't gate on a single build-and-test job. Looking at that...

Our integration tests are getting slower, and it's a bit hard
to avoid because we really do want to do some medium-expensive
thing like disk image generation across multiple base images.

Split integration tests across 4 parallel GHA runners using nextest's
really cool hash-based sharding.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
The bootc-ubuntu-setup action was recently added and provides
consolidated setup for podman, just, libvirt, KVM permissions,
and Rust caching. Both the build and integration-tests jobs
were duplicating this setup code.

Replace the duplicated setup steps with the shared action.
The only additional dependency needed is go-md2man in the build job.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
The integration tests were creating separate disk images for tests
that could share the same VM, causing unnecessary duplication of
expensive `to-disk` operations.

Changes:
- Merged `test_base_disks_list_shows_timestamp` into
  `test_base_disk_creation_and_reuse` - the timestamp test no longer
  needs its own VM, it can verify the list output after the reuse test
  creates VMs
- Created `test_libvirt_comprehensive_workflow` that consolidates
  multiple separate tests (`test_libvirt_run_list_json_ssh_metadata`,
  `test_libvirt_run_with_instancetype`, and
  `test_libvirt_run_label_functionality`) into a single test that
  creates one VM and verifies:
  - Instance type configuration
  - Label metadata and filtering
  - JSON output with SSH metadata
  - VM lifecycle

This reduces the number of expensive disk image creations in CI,
improving test performance while maintaining the same test coverage.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters
Copy link
Copy Markdown
Collaborator Author

OK I reworked the CI gating to now require required-tests, if that pattern works out let's propagate it.

@cgwalters cgwalters requested a review from jmarrero November 6, 2025 17:27
Copy link
Copy Markdown
Collaborator

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

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

lgtm

@cgwalters cgwalters merged commit ffd9870 into bootc-dev:main Nov 7, 2025
7 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.

2 participants