Skip to content

fix(ci): point PR unit-tests at the CDK-managed V3 project - #6082

Merged
jam-jee merged 1 commit into
aws:masterfrom
jam-jee:fix/pr-checks-use-cdk-managed-unit-project
Jul 23, 2026
Merged

fix(ci): point PR unit-tests at the CDK-managed V3 project#6082
jam-jee merged 1 commit into
aws:masterfrom
jam-jee:fix/pr-checks-use-cdk-managed-unit-project

Conversation

@jam-jee

@jam-jee jam-jee commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Issue

The PR-check unit-tests job invokes per-submodule CodeBuild projects named sagemaker-python-sdk-ci-<submodule>-unit-tests. Investigation showed these are orphaned, manually-created projects — not managed by the SageMakerMLFPySDKInfraCDK pipeline:

ci-sagemaker-core-unit-tests (PR checks use) ci-health-unit-test-v3 (CDK-managed)
CloudFormation tags none (manual) aws:cloudformation:* present
buildspec tox … --cov=. tox … --cov=sagemaker
lastModified 2026-06-15 (stale) 2026-07-20

Because the manual projects aren't pipeline-managed, the deployed buildspec CR (--cov=.--cov=sagemaker) never reached them. PR coverage therefore kept reporting the old, test-file-inflated numbers (~90% / sessions=1, 3 files, 37% on merged uploads) instead of the intended product-only coverage. Verified end-to-end: a fresh build on the PR-check project (commit 6b41b3f0, run 2026-07-22) still executed --cov=..

Fix

Point the unit-tests job at the single CDK/pipeline-managed project sagemaker-python-sdk-ci-health-unit-test-v3 (createCIUnitV3BuildSpec), driven by the SUBMODULE env var — exactly how ci-health.yml already invokes it. That project carries the deployed --cov=sagemaker buildspec, so:

  • PR coverage now reflects the intended product-only measurement (test files excluded).
  • CI wiring stays in sync with the CDK, so future buildspec changes deploy through the pipeline and reach PR checks automatically.

The source-version-override is preserved so the PR's own code is tested (not master). The matrix still fans out per changed submodule via detect-changes.

Follow-ups (separate)

  • Retire the orphaned manual sagemaker-python-sdk-ci-<submodule>-unit-tests projects.
  • The CodeBuild→Codecov uploader still sends empty branch/pr=false/no -F flags (a separate buildspec issue), which affects whether the report attaches to the PR and whether the 4 sub-uploads merge. Tracked separately.

Testing

  • python -c "import yaml; yaml.safe_load(open('.github/workflows/pr-checks-master.yml'))" → parses.
  • Confirmed target project sagemaker-python-sdk-ci-health-unit-test-v3 exists, is CFN-managed, and its deployed buildspec contains --cov=sagemaker.

The PR-check `unit-tests` job invoked per-submodule CodeBuild projects
named `sagemaker-python-sdk-ci-<submodule>-unit-tests`. Those projects
were created manually (no CloudFormation tags) and are not managed by the
SageMakerMLFPySDKInfraCDK pipeline, so they drifted stale: they still run
`tox ... --cov=.` (last modified 2026-06-15) even though the merged and
deployed buildspec CR changed this to `--cov=sagemaker`. As a result PR
coverage kept reporting the old test-file-inflated numbers and never
reflected the fix.

Point the job at the single CDK/pipeline-managed project
`sagemaker-python-sdk-ci-health-unit-test-v3` (createCIUnitV3BuildSpec),
driven by the `SUBMODULE` env var, exactly as the ci-health workflow
invokes it. This project carries the deployed `--cov=sagemaker` buildspec,
so PR coverage now tracks the intended product-only measurement, and the
CI wiring stays in sync with the CDK going forward.

The manual per-submodule `-unit-tests` projects can be retired separately.
@jam-jee
jam-jee merged commit 8c3096f into aws:master Jul 23, 2026
6 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.

3 participants