Commit graph

9 commits

Author SHA1 Message Date
Alexander Larsson
891bbcec17 Add test for org.osbuild.containers.storage.conf stage 2023-12-12 09:54:38 +01:00
Michael Vogt
26fa3aec8c tox: move to pylint 3.0.2 for py312 support
With python 3.12 our pylint version breaks because of
https://github.com/pylint-dev/astroid/issues/2201

This is fixed in 3.0.0a6 but it seems sensible to move
to 3.0.2.
2023-11-15 18:31:56 +01:00
Michael Vogt
d52738d70c tools: add "tools" dir to LINTABLES and fix issues
The `./tools` dir was not part of the LINTABLES in the `tox.ini`
which meant that pep8/pylint etc checks were not run on the tools
there.

This commit adds it and fixes the issues that `make lint` found.
2023-11-13 10:10:12 +01:00
Michael Vogt
ce8bc6dc1f stages(kickstart): run ksvalidator as part of the tests
Run `ksvalidator` as part of the test_kickstart.py tests. This
ensures that the file we write is valid.
2023-11-08 18:49:35 +01:00
Michael Vogt
0edbe0cf96 tests: run the test_stages category in parallel
Run the `test_stages` test in parallel in the github runner. This
test currently takes about 1:30h to 2:30h and running it in parallel
will give us big wins in terms of test time. The time is observed
to go down to 0:30h to 1h.

Note that the other tests are not run in parallel. The reason is
that they fail randomly, it looks like insufficient isolation
between them. Some are easy to fix, e.g.:
721521220b
but it's probably not worth it as the other tests run a lot faster.
2023-11-08 08:10:34 +01:00
Michael Vogt
ed95c10530 stages: add new unit test for kickstart stage
This commit adds a simple and lightweight unit test for the new
kickstart options. It's pretty simple but also cheap and runs
fast.
2023-11-07 15:12:08 +01:00
Brian C. Lane
a7541ad8b4 tox: Pin pycodestyle to 2.10.0
They changed their API in 2.11.0 and broke autopep8
See:
https://github.com/hhatto/autopep8/issues/689
and
https://github.com/hhatto/autopep8/pull/696
2023-08-10 13:04:14 +02:00
Brian C. Lane
2047a8efbc autopep8: Increase aggressive level 2023-08-10 13:04:14 +02:00
Simon de Vlieger
d60690ce46 tox: add tox
`tox` is a standard testing tool for Python projects, this allows you to
test locally with all your installed Python version with the following
command:

`tox -m test -p all`

To run the tests in parallel for all supported Python versions.

To run linters or type analysis:

```
tox -m lint -p all
tox -m type -p all
```

This commit *also* disables the `import-error` warning from `pylint`,
not all Python versions have the system-installed Python libraries
available and they can't be fetched from PyPI.

Some linters have been added and the general order linters run in has
been changed. This allows for quicker test failure when running
`tox -m lint`. As a consequence the `test_pylint` test has been removed
as it's role can now be fulfilled by `tox`.

Other assorted linter fixes due to newer versions:
- use a str.join method (`consider-using-join`)
- fix various (newer) mypy and pylint issues
- comments starting with `#` and no space due to `autopep8`

This also changes our CI to use the new `tox` setup and on top of that
pins the versions of linters used. This might move into separate
requirements.txt files later on to allow for easier updating of those
dependencies.
2023-08-01 15:01:13 +02:00