Skip to content

ci: add change-aware unit test check workflow#833

Open
zyl1121 wants to merge 1 commit into
TencentCloud:masterfrom
zyl1121:unit-test-workflow
Open

ci: add change-aware unit test check workflow#833
zyl1121 wants to merge 1 commit into
TencentCloud:masterfrom
zyl1121:unit-test-workflow

Conversation

@zyl1121

@zyl1121 zyl1121 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Motivation

The repository already has a Build Check workflow, but there is no dedicated unit test workflow for PRs.

Build checks catch compile and packaging issues, but they do not provide the same signal as running component unit tests. Adding a PR-triggered unit test workflow helps catch regressions earlier and improves PR quality before review and merge.

Running every service test for every small change would be expensive and noisy, so this PR adds a change-aware workflow that reuses the existing builder-based CI pattern.

What Changed

  • Add unit-test-check.yml for pull_request, push, and workflow_dispatch events.
  • Map changed paths to component test targets, so the workflow schedules only the matching unit test jobs.
  • Add the initial unit-test matrix for components that can currently run in the shared builder-based GitHub Actions environment:
    • CubeAPI
    • CubeShim
    • network-agent
  • Add builder-backed *-test targets to the root Makefile.
  • Add missing make test entrypoints for CubeAPI and CubeShim.
  • Bump the builder image Go version from 1.24 to 1.25.7 so the shared builder toolchain matches newer Go-module requirements already present in the repository.

Validation

Local validation:

  • make -n cubeapi-test cube-api-test shim-test network-agent-test

Fork workflow validation:

  • A fork-side child PR touching CubeAPI/Makefile triggered only Test CubeAPI.
  • A fork-side child PR touching CubeAPI/Makefile and CubeShim/Makefile triggered only Test CubeAPI plus Test CubeShim.
  • The selected jobs reached the real component test commands, confirming that workflow dispatch and target selection work as intended.

Build workflow validation:

  • Confirmed the existing Build Check still passes after bumping the builder image Go version from 1.24 to 1.25.7.

Scope

This first workflow only includes components whose unit tests can currently run in the shared builder-based GitHub Actions environment.

It intentionally leaves other components, SDK tests, integration tests, smoke tests, and e2e tests for follow-up PRs. Some excluded components already reach real test execution but still require component-specific fixture, environment, or test-debt cleanup before they can be safely added to the default PR matrix.

Build Check remains unchanged as the broad build workflow. The changed-path narrowing introduced here only applies to the new Unit Test Check.

Add a Unit Test Check workflow for pull_request, push, and workflow_dispatch
events. The workflow selects component test jobs from changed file paths.

Start the matrix with CubeAPI, CubeShim, and network-agent, which can currently
run in the shared builder-based GitHub Actions environment.

Add root builder-backed test targets and the missing make test entrypoints for
CubeAPI and CubeShim.

Bump the builder image Go version from 1.24 to 1.25.7 so the shared builder
toolchain matches newer Go requirements already declared in the repository.

Signed-off-by: zhengyilei <zheng_yilei@qq.com>
@fslongjin fslongjin moved this from Todo to In progress in CubeSandbox Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants