appledora / mwparserfromhtml

An unofficial mirror of our repo of the `mwparserfromhtml` package. It is a python library for working with the HTML dumps. Since this is only a mirror, DO NOT PR.
https://pypi.org/project/mwparserfromhtml/
MIT License
4 stars 0 forks source link

Add tests to CI pipeline #14

Closed appledora closed 2 years ago

appledora commented 2 years ago

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.

appledora commented 2 years ago

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.

appledora commented 2 years ago

In GitLab by @geohci on Jul 5, 2022, 19:51

Oh yes, good point! Would you recommend just running flake8 and having logs that can be checked (example) or actually enforcing something like black? Or something else?

appledora commented 2 years ago

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.