You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #51 added scripts/rock_tagging.py, which automates annotated-tag creation and GitHub
release publishing for TheRock and all tracked ROCm submodules. The current test plan is
fully manual (dry-run inspection, option verification). This issue tracks adding automated
unit tests so the logic can be verified in CI without cloning real repos or pushing real tags.
What needs to be done
Add a test file scripts/tests/test_rock_tagging.py using unittest and unittest.mock.
All subprocess calls must be mocked — no network access, no real git operations.
Tests to implement
convert_to_ssh
HTTPS GitHub URL → correct git@github.com: SSH form
Already-SSH URL → returned unchanged
Non-GitHub URL → returned unchanged
get_submodule_url_map
Missing .gitmodules → returns {}
Valid .gitmodules with multiple submodules → returns correct path→URL mapping
git config --get-regexp failure → returns {}
Submodule with no URL entry → that entry is skipped, others returned
build_plan
Happy path: mocked clone + submodule status + .gitmodules → correct dict[str, RepoInfo] including TheRock itself
Non-ROCm submodule URLs are filtered out
--exclude-list entries are skipped
Existing cached clone is reused (no second clone)
--force-clone deletes and reclones when cache dir is not a valid git repo
Missing fetch_sources.py → falls back to git submodule update
execute_plan
Tag created and pushed for each repo in plan
Pre-existing tag → creation skipped, component counted as success
Remote setup failure → component counted as failed, loop continues
gh release create called with correct tarball assets for mono-repos (rocm-libraries, rocm-systems)
Context
PR #51 added
scripts/rock_tagging.py, which automates annotated-tag creation and GitHubrelease publishing for TheRock and all tracked ROCm submodules. The current test plan is
fully manual (dry-run inspection, option verification). This issue tracks adding automated
unit tests so the logic can be verified in CI without cloning real repos or pushing real tags.
What needs to be done
Add a test file
scripts/tests/test_rock_tagging.pyusingunittestandunittest.mock.All subprocess calls must be mocked — no network access, no real git operations.
Tests to implement
convert_to_sshgit@github.com:SSH formget_submodule_url_map.gitmodules→ returns{}.gitmoduleswith multiple submodules → returns correct path→URL mappinggit config --get-regexpfailure → returns{}build_plan.gitmodules→ correctdict[str, RepoInfo]including TheRock itself--exclude-listentries are skipped--force-clonedeletes and reclones when cache dir is not a valid git repofetch_sources.py→ falls back togit submodule updateexecute_plangh release createcalled with correct tarball assets for mono-repos (rocm-libraries,rocm-systems)gh release createfailure → component counted as failed, not as succeeded(regression test for the double-counting bug fixed in Add release tag and GitHub release automation script for TheRock and ROCm submodules #51)
gh release create, correct[DRY RUN]log