Skip to content

Unit tests#216

Open
cmelone wants to merge 49 commits into
llnl:mainfrom
cmelone:add/unit-tests
Open

Unit tests#216
cmelone wants to merge 49 commits into
llnl:mainfrom
cmelone:add/unit-tests

Conversation

@cmelone

@cmelone cmelone commented Jan 22, 2026

Copy link
Copy Markdown
Member

This PR adds unit tests for Hubcast. The goal of these tests is not to evaluate the end-to-end functionality of Hubcast, but to ensure that our business logic stays consistent.

Subsequent PRs will include integration tests to ensure that the input/output format of external APIs does not impact live Hubcast users. For example, the GitHub and GitLab clients under src/clients and the app entrypoint (src/__main__.py) will be covered as integration tests.


complete:

  • GitHub route handlers
  • account map logic
  • repo configuration
  • token cache (abstractly, no integration with GH/GL)

TODO:

  • app configuration (env variable getting, not going to test the config classes)
  • GitHub handler/spawning logic
  • GitLab route handlers
  • GitLab handler/spawning logic
  • LDAP account map
  • Add CI coverage check #218
  • if any PRs are merged before this, make sure they're covered in these tests

run a local coverage report:

coverage run --source=src -m pytest tests && coverage html

@github-actions github-actions Bot added the dependencies Modifications to a Dependency File label Jan 22, 2026
Comment thread tests/test_repo_config.py
@cmelone cmelone requested a review from alecbcs January 22, 2026 01:02
@github-actions github-actions Bot added the ci Involving Project CI & Unit Tests label Jan 22, 2026
@cmelone cmelone added the tests Modifications to App Unit Tests label Jan 22, 2026
@cmelone cmelone force-pushed the add/unit-tests branch 2 times, most recently from 7eab20c to ffd946a Compare January 22, 2026 16:55
@cmelone cmelone mentioned this pull request Jan 22, 2026
@cmelone cmelone force-pushed the add/unit-tests branch 3 times, most recently from 0606c01 to 8b60a91 Compare March 11, 2026 22:55
@cmelone cmelone force-pushed the add/unit-tests branch 2 times, most recently from 3abb954 to 22eddf7 Compare March 25, 2026 00:03
Comment thread src/hubcast/account_map/file.py Outdated
@cmelone cmelone force-pushed the add/unit-tests branch 5 times, most recently from cb54666 to e36297b Compare April 14, 2026 22:11
@cmelone cmelone force-pushed the add/unit-tests branch 2 times, most recently from e364242 to 66f5641 Compare May 20, 2026 17:19
@cmelone cmelone linked an issue May 22, 2026 that may be closed by this pull request
@cmelone cmelone force-pushed the add/unit-tests branch 3 times, most recently from 41397c6 to 9f1925f Compare May 26, 2026 23:45
alecbcs
alecbcs previously approved these changes Jun 1, 2026

@alecbcs alecbcs 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.

A couple super small nitpicks, otherwise this PR looks good to me.

Comment thread .github/workflows/ci.yml
Comment thread spack/repos/spack_repo/hubcast/packages/py_hubcast/package.py Outdated
Comment thread spack/repos/spack_repo/hubcast/packages/py_hubcast/package.py Outdated
Comment thread spack/repos/spack_repo/hubcast/packages/py_hubcast/package.py Outdated
Comment thread spack/repos/spack_repo/hubcast/packages/py_hubcast/package.py Outdated
Comment thread src/hubcast/web/github/routes.py Outdated
cmelone and others added 28 commits June 12, 2026 11:07
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Co-authored-by: Alec Scott <scott112@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Involving Project CI & Unit Tests dependencies Modifications to a Dependency File tests Modifications to App Unit Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CI coverage check

2 participants