Skip to content

ci: extract unit and integration test steps into composite actions - #3522

Merged
sitole merged 1 commit into
mainfrom
ci/composite-test-actions
Aug 3, 2026
Merged

sitole merged 1 commit into
mainfrom
ci/composite-test-actions

Conversation

@sitole

@sitole sitole commented Aug 3, 2026

Copy link
Copy Markdown
Member

Description

This PR moves the test step logic out of the workflows and into two composite actions:

  • .github/actions/unit-tests runs the unit test shard for one package, including the host setup that the package needs.
  • .github/actions/integration-tests runs the integration suite on one configuration, from database startup to the data race check.

The workflows (pr-tests.yml, integration_tests.yml) keep the matrices, the sharding strategy, and the Codecov and artifact uploads. With the logic in actions, other workflows can run the same test steps without a copy of them.

Changes in behavior

  • The integration-tests action starts the databases itself. The action runs this step first, so the image pulls still overlap with the package builds.
  • The integration-tests action takes test-shard, tests-only, and test-parallelism as inputs. Before, the workflow set these values through environment variables.
  • The unit-tests action always writes coverage.txt and junit.xml. The Codecov upload steps in pr-tests.yml are unchanged.

No changes

  • The test commands, timeouts, and host setup steps are identical to the previous inline versions.
  • The matrices, the runners, and the aggregate jobs are unchanged.

Testing

  • All four YAML files parse.
  • The refactor moves the steps verbatim; the diff shows the moved blocks.

Moves the test step logic from pr-tests.yml and integration_tests.yml
into two composite actions (.github/actions/unit-tests and
.github/actions/integration-tests) so that other workflows can run the
same steps. The workflows keep the matrices, sharding strategy, and
Codecov/artifact uploads.

Behavior changes:
- The integration-tests action starts the databases itself (first step,
  so the pulls still overlap with the package builds).
- The integration-tests action takes test-shard, tests-only, and
  test-parallelism as inputs instead of workflow-level env.
@cursor

cursor Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
CI-only structural change; test commands and host setup are unchanged aside from new optional orchestrator-path wiring that defaults to the existing path.

Overview
This refactor centralizes PR unit-test and integration-test execution in reusable composite actions so other workflows can run the same steps without duplicating them. The workflows keep matrices, sharding, and Codecov or artifact uploads; shard, allow-list, and parallelism settings for integration tests move from inline env vars to action inputs. The integration action also adds optional alternate orchestrator build path support with a pgrep check so a mismatched start-services version does not silently run the default binary.

Reviewed by Cursor Bugbot for commit a92fbdf. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@sitole
sitole enabled auto-merge (squash) August 3, 2026 09:15
@sitole
sitole merged commit 9ff30a5 into main Aug 3, 2026
51 checks passed
@sitole
sitole deleted the ci/composite-test-actions branch August 3, 2026 09:21

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM — clean, verbatim extraction of existing CI steps into reusable composite actions.

Extended reasoning...

Overview

This PR refactors .github/workflows/pr-tests.yml and .github/workflows/integration_tests.yml by extracting their inline step sequences into two new composite actions, .github/actions/unit-tests and .github/actions/integration-tests. The workflows retain the matrices, sharding, and Codecov/artifact upload steps; the actions own the mechanical work (host setup, test execution, data-race checks). I diffed the moved blocks against the new action files and confirmed the step bodies, env vars, and shell commands are unchanged — this is a verbatim move, not a rewrite. The new orchestrator-make-path input on the integration-tests action is unused by both call sites in this PR (default value only), so it introduces no behavior change today; it's scaffolding for a future caller.

Security risks

None. This is CI-only, no production code paths, and secrets handling (CODECOV_TOKEN, test-only fake credentials in start-services) is passed through unchanged via existing secret/input mechanisms.

Level of scrutiny

Low-to-moderate is appropriate: this is a CI workflow refactor, not application logic, and the description explicitly claims a verbatim move which I verified against the diff. A regression here would surface immediately and loudly (broken CI on this or the next PR) rather than silently, which lowers the cost of being wrong.

Other factors

The bug-hunting system found no issues, and the two candidate issues it investigated (orchestrator-make-path being ignored by start-services, and the pgrep verification pattern) were correctly ruled out — that input/step pair is dead code under the current call sites (always default value), so it can't affect this PR's actual behavior. No outstanding review comments exist on the PR.

jakubno pushed a commit that referenced this pull request Aug 3, 2026
…3522)

# Description

This PR moves the test step logic out of the workflows and into two
composite actions:

- `.github/actions/unit-tests` runs the unit test shard for one package,
including the host setup that the package needs.
- `.github/actions/integration-tests` runs the integration suite on one
configuration, from database startup to the data race check.

The workflows (`pr-tests.yml`, `integration_tests.yml`) keep the
matrices, the sharding strategy, and the Codecov and artifact uploads.
With the logic in actions, other workflows can run the same test steps
without a copy of them.

## Changes in behavior

- The `integration-tests` action starts the databases itself. The action
runs this step first, so the image pulls still overlap with the package
builds.
- The `integration-tests` action takes `test-shard`, `tests-only`, and
`test-parallelism` as inputs. Before, the workflow set these values
through environment variables.
- The `unit-tests` action always writes `coverage.txt` and `junit.xml`.
The Codecov upload steps in `pr-tests.yml` are unchanged.

## No changes

- The test commands, timeouts, and host setup steps are identical to the
previous inline versions.
- The matrices, the runners, and the aggregate jobs are unchanged.

# Testing

- All four YAML files parse.
- The refactor moves the steps verbatim; the diff shows the moved
blocks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants