-
Notifications
You must be signed in to change notification settings - Fork 4
DAS-2431: HOSS tests locally and in docker, artifacts are captured #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
You can now run the tests in docker or in your local environment. ARM vs AMD will not affect the outputs at the test level.
This was modifying the test and it could only be run one time before generating errors.
This just uses pytest-cov to generate coverage and relocates the output to the same place whether you run from docker or the commandline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good. I ran the tests (both inside and outside of Docker) and confirmed the coverage and test report directories were created in each case. I also confirmed the test coverage summary is being written to stdout once again. I'm going to approve it but there is one typo I found that you may want to fix.
CHANGELOG.md
Outdated
| @@ -1,3 +1,13 @@ | |||
| ## [unrleased] - 2025-10-20 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are great. I ran both the Docker image and the local script to execute the tests and both times the expected directories (coverage and test-reports) were made in the expected locations. I also confirmed the GitHub workflow that was triggered for this PR - the artefacts were saved as expected. 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests all passed. Good to be able to run the tests outside docker without failures.
| @@ -1,7 +1,5 @@ | |||
| coverage~=7.9.2 | |||
| pre-commit~=4.2.0 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to keep pre-commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not used in any of the images. It's a local dependency that you should install yourself. GitHub uses https://pre-commit.ci/ as a check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other approach would be a separate dev_requirements.txt in the root of the repository. It feels like overkill for a single package, though.
Generally, pre-commit is now being used pretty much all the Python-based Harmony services DAS maintains. It should probably just be something that is manually installed by developers when setting up a new environment for a service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed that it was called out in the README. I'll update that. I don't think we need it for any testing purposes in the images still
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moves into utility function.
Jira Issue ID
precursor to DAS-2431
Local Test Steps
Pull this branch and run the tests.
Verify tests run. And you have output in your
hoss/coverageandhoss/test-reportsdirectories.Delete those directories for the next step.
Bonus points, you can build a local environment with
Then install the dependencies from
pip_requirements.txtandtests/pip_test_requirements.txtrun the tests directly from the root (outside of docker)
They should all pass again and you have output in your
hoss/coverageandhoss/test-reportsdirectories.PR Acceptance Checklist
Jira ticket acceptance criteria met.CHANGELOG.mdupdated to include high level summary of PR changes.docker/service_version.txtupdated if publishing a release.Documentation updated (if needed).