Skip to content

feat(ci): enable unit tests for release automation scripts - #110

Open
amd-chiranjeevi wants to merge 6 commits into
mainfrom
users/amd-chiranjeevi/add_unit_tests
Open

feat(ci): enable unit tests for release automation scripts#110
amd-chiranjeevi wants to merge 6 commits into
mainfrom
users/amd-chiranjeevi/add_unit_tests

Conversation

@amd-chiranjeevi

@amd-chiranjeevi amd-chiranjeevi commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Motivation

Rockrel has two Python scripts (create_release_branch.py, rock_tagging.py) with corresponding test files (scripts/tests/test_create_release_branch.py, scripts/tests/test_rock_tagging.py) that were never wired into CI. Any regression in the branching or tagging automation could go undetected until it fails in a real release run.
This PR adds a GitHub Actions workflow that runs those tests automatically on every push to main, every PR, and on demand.

closes #103

Changes

.github/workflows/unit_tests.yml — new workflow that:
- Triggers on push to main/release/therock-* and all pull requests (no path filters,
so it can be used as a required check)
- Runs on a matrix of ubuntu-24.04 and windows-2022 (with shell: bash default)
- Sets up Python 3.12, installs deps, runs pytest with verbose output, duration reporting,
and coverage
- Uploads a per-OS HTML coverage report as an artifact
- Has a unit_tests_summary job that fails the workflow if any matrix leg didn't succeed

requirements-test.txt — new file pinning:
- pytest==9.0.3 (same version as TheRock; this version has subtests built-in)
- pytest-cov==6.0.0 (same version as TheRock)

Test Result

unit tests working - https://github.com/ROCm/rockrel/actions/runs/33774002311/job/100711034535?pr=110

Submission Checklist

@arjun-raj-kuppala

Copy link
Copy Markdown

One point from my end would be to run these unit tests when specific release automation scripts get updated as tests are related to that only.

@amd-chiranjeevi amd-chiranjeevi changed the title feat(ci): add unit tests workflow feat(ci): enable unit tests for release automation scripts Sep 3, 2026

@ScottTodd ScottTodd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Please tag #103 in the PR description

Comment on lines +25 to +28
jobs:
unit_tests:
name: Release Unit Tests
runs-on: ubuntu-24.04

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • Runs on ubuntu-24.04 (matches all other rockrel workflows; no Windows needed since these
    are pure Python automation scripts)

Run on Windows too. Several of us, myself included, develop exclusively on Windows and scripts need to work there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, added a matrix with [ubuntu-24.04, windows-2022], fail-fast: false.

Comment thread .github/workflows/release_unit_tests.yml Outdated
Comment thread .github/workflows/release_unit_tests.yml Outdated
Comment thread .github/workflows/release_unit_tests.yml Outdated
Comment thread requirements-test.txt

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: could use requirements-test.txt instead of requirements.txt.

Comment on lines +41 to +45
- name: Test scripts
working-directory: scripts
run: |
python -m pytest -vv --durations=20 \
--cov --cov-report=term-missing --cov-report=html

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we just run pytest from the repository root for now? That should cover future subdirectories too. If we add subdirectories that can't pass pytest collection we can exclude them or reorganize then.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@ScottTodd ScottTodd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great, thank you

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.

[Issue] [Branching automation] Enable unit tests in CI pipeline

3 participants