Add tests to CI pipeline
appledora opened this issue · 3 comments
In GitLab by @geohci on Jul 1, 2022, 04:32
Auto-run pytest tests for merge requests. This will make it easier to check that the code continues to operate as expected and incentivize us expanding our test suite.
In GitLab by @sstefanova on Jul 4, 2022, 16:17
If you can, consider adding linting/formatting at the same time – it's a cheap way to increase code quality and saves reviewers from having to nitpick on minor stuff.
In GitLab by @sstefanova on Jul 6, 2022, 24:50
A typical combo would be flake8 + black + isort. There is pylint as well, as an alternative or in addition to flake8. Personally, I find it a bit too nitpicky, but if you have worked with it before and like it, it's definitely as solid choice.
I'm new to GitLab and have never run CI/CD here before. In the mwsql repo, I use tox to run both the pytest test suite and all linters/formatters (these in turn run via pre-commit). On my machine, I run tox directly; the CI/CD pipeline runs tox through GitHub actions.