Commit Graph

12 Commits

Author SHA1 Message Date
Martí Bolívar e432aff137 Add docker compose based testing
Our release process documentation recommends getting passing tox
results on as many popular linux distributions as time allows. Doing
this by hand is cumbersome, redundant, and error prone.

Add a directory with a helper script that automates the entire process
using docker compose and document its use in MAINTAINERS.rst.

Signed-off-by: Martí Bolívar <mbolivar@amperecomputing.com>
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-09-25 07:18:42 -07:00
Pieter De Gendt 4c4dc04755 project: ignore .venv directory
Additionally exclude the python .venv directory for flake8 if it exists.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-22 09:29:26 -07:00
Martí Bolívar f393a18e1c .gitignore: add .dir-locals.el
This is an emacs configuration file that developers can add to
configure their development environments on a project-wide basis.

I would rather avoid leaking one into the main repository, so I'm
going to just ignore it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-14 14:44:52 -07:00
Martí Bolívar 25d24287a8 .gitignore: add htmlcov/
This includes coverage data in human-readable format. It's generated
by tox.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-06-30 12:04:35 -07:00
Gerard Marull-Paretas 26b69f987e west: initial support for type hints
These changes introduce initial support for type hints. Support for mypy
static analysis on GitHub workflows has also been enabled.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-06-02 10:58:40 -07:00
Martí Bolívar 8a1c40e6d1 .gitignore: exclude more coverage files
Catch the .coverage.NNNN.MMMM files too.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-05 13:12:23 -08:00
Martí Bolívar 82cf0e3630 .gitignore: add .coverage
This is a SQLite database of coverage data now generated by default
during testing by pycov.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-01-22 07:36:31 -05:00
Marti Bolivar 18060dd02a tests: use tox and overhaul project testing
To properly test the project commands, it would be best to have a
fresh west bootstrapper package created and installed on PATH, so it
could be used to run commands exactly as they'd happen if we package
and ship the working tree.

To make that easier, add a dependency on tox and use it for testing:

https://tox.readthedocs.io/en/latest/

From now on, we'll test west by running 'tox' from the repository
root.  This has several advantages over running pytest directly:

- "Just run tox": there are no longer any differences in test invocation
  between POSIX OSes and Windows.

- tox creates an sdist package of the current tree using our setup.py
  and installs it into a new virtual environment, then runs tests
  there.  This removes interference from other packages installed on
  the host (like released bootstrappers that are also installed)

- we get to run multiple shell commands in order, should that ever be needed,
  in our test procedures in a way that won't affect users

With that done, we can re-work the multirepo command testing to invoke
the bootstrapper in the virtual environment, adding various tests and
filling in longstanding testing gaps by adding increased checking of
the results (currently, much of the testing just checks whether
commands do or do not error out, which isn't enough).

These changes were made with a view towards the upcoming changes which
are planned before releasing west "into the wild": the test case code
should be mostly the same before and after the changes, so this serves
as a good baseline against regressions introduced by those upcoming
changes.

Signed-off-by: Marti Bolivar <marti@foundries.io>

[wip] debugging shippable results

Signed-off-by: Marti Bolivar <marti@foundries.io>

[wip] just test one py3

shutil.which west is picking up a 3.4 version in the 3.6 test, oddly

Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-01-09 11:21:05 -07:00
Marti Bolivar 3a24890a24 testing: add shippable integration
This ought to run the tests across a good enough spread of supported
Python versions to get started, and collect coverage statistics.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-08-21 14:54:29 -05:00
Marti Bolivar 9b7d58343f Add py.test-based test infrastructure
Follow along with what the cool kids are doing and add py.test
integration.

This patch doesn't add any test cases, but sets up packages to
test the runner classes as additional work.

To run the test suite, use:

$ python3 setup.py test

Since there are no tests, these pass.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-08-20 09:17:57 -07:00
Marti Bolivar 4d75a749d0 .gitignore: add __pycache__/
Clean up the status output.

Signed-off-by: Marti Bolivar <marti.f.bolivar@gmail.com>
2018-06-11 21:43:50 -04:00
Marti Bolivar 2e9e6b255d Add setuptools integration.
Follow along with the tutorial:

https://packaging.python.org/tutorials/packaging-projects/

The version number is because of repeated uploads to TestPyPI.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-06-06 12:21:14 -04:00