Skip to content

test(crs): add unit tests for build_target, output checks, and entry init - #566

Open
ChandanKT-git wants to merge 1 commit into
ossf:mainfrom
ChandanKT-git:test/crs-build-target
Open

ChandanKT-git wants to merge 1 commit into
ossf:mainfrom
ChandanKT-git:test/crs-build-target

Conversation

@ChandanKT-git

@ChandanKT-git ChandanKT-git commented Dec 4, 2026 •

Copy link
Copy Markdown

Summary

Add unit tests in oss_crs/tests/unit/test_crs_build_target.py covering CRS.from_yaml_file, CRS.from_crs_compose_entry, CRS.is_target_built, CRS.build_target (cache hit, stale-cache rebuild when outputs are missing, image-hash/tag failure paths, and target_dependent run image builds), and get_image_content_hash in oss_crs/src/crs.py.

This complements the prepare-phase and init_crs_repo tests in test_crs_prepare.py (added in #312) and test_offline_flag.py, raising oss_crs/src/crs.py unit coverage from 52% to 87% without modifying production code.

User Impact

  • User-facing change
  • Internal-only change

Release Note / Changelog

  • I updated CHANGELOG.md ([Unreleased]) for user-facing changes
  • No changelog entry needed (internal-only refactor/test/chore)

Validation

Ran uv run verify:

  • ruff check oss_crs oss-crs-infra libCRS: passed
  • ruff format --check oss_crs oss-crs-infra libCRS: 129 files already formatted
  • pyright oss_crs/src libCRS/libCRS oss-crs-infra: 0 errors, 0 warnings
  • pytest -m "not integration" -v oss_crs: 835 passed, 29 deselected
  • pytest -m "not integration" -o pythonpath=libCRS -v libCRS/tests: 31 passed

Checklist

  • I followed Conventional Commits
  • I updated docs for behavior/config/CLI changes
  • I added/updated tests for behavior changes
  • I considered backward compatibility and migration impact

…init

Signed-off-by: Chandan K T <cktofficial24@gmail.com>

This branch has not been deployed

No deployments
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.

1 participant