Skip to content
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

Add CI testing of unittests and linting #16

Merged
merged 24 commits into from
Jul 27, 2022

Conversation

andrewphilipsmith
Copy link
Collaborator

Initially, add whitespace and pretty-print formatters.

@andrewphilipsmith andrewphilipsmith changed the title Add pre-commit hooks Add CI testing of unittests and linting Jul 26, 2022
@andrewphilipsmith
Copy link
Collaborator Author

andrewphilipsmith commented Jul 26, 2022

@crangelsmith - I think that this is now ready to merge.

This reproduces in GitHub Actions some of the tests that are run in Travis-CI in monitoring-ecosystem-resilience.

  • Only tests relevant to pyveg are reproduced. None of the tests relevant to rveg are run.
  • Due to issue Function get_tags() fails when run from a clone without that git history present #19, one of the tests fails in CI (pytest pyveg/tests/test_combiner_modules.py::test_combine). In my opinion, this is due to a bug in the production code, not the CI or the tests. For now, the relevant test is skipped on CI but still runs locally.

Additionally, this PR adds linting rules via pre-commit (black, isort, autopep8, various whitespace formatters). These rules are repeated on the CI. As a result, this PR touches a lot of files - though most of these changes are minor. (With the benefit of hindsight I think that this should have been two separate PRs).

If/when merged, this PR would close #1.

Copy link
Collaborator

@crangelsmith crangelsmith left a comment

Choose a reason for hiding this comment

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

LGTM!

I see the pre-commit hooks checks are failing after updating main with PR #14 , anything I should do on that front?

@andrewphilipsmith
Copy link
Collaborator Author

I see the pre-commit hooks checks are failing after updating main with PR #14 , anything I should do on that front?

Not for now thanks - I'm working on this and will let you know if there is anything.

@andrewphilipsmith
Copy link
Collaborator Author

I have disabled a second test on CI, due to issue #20. In this case, I suspect (though haven't confirmed) that the problem is with the test code, not the CI or the production code.

In order to complete this PR, I've opted to disable the test on CI, rather than delay implementing the rest of the CI/liniting checks.

@andrewphilipsmith andrewphilipsmith merged commit a0d5e56 into main Jul 27, 2022
@andrewphilipsmith andrewphilipsmith deleted the feature/test-automation branch July 27, 2022 12:27
@andrewphilipsmith andrewphilipsmith linked an issue Jul 27, 2022 that may be closed by this pull request
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.

Setup CI using Github Actions
2 participants