Commit Graph

12 Commits

Author SHA1 Message Date
Martí Bolívar 16e2250e45 manifest: hacky import loop detection
I keep running into edge cases trying to get proper import loop
detection going, so just catch the RecursionError it causes and
convert it to ManifestImportFailed.

Testing this takes a while, so we only will do that from CI for now.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-04 08:11:19 -08:00
Anas Nashif 45b91bd11e ci: move west to a different node pool
This new pool uses large nodes and suitable for anything that does not
run sanitycheck. The queue for this pool is not as a long as with the
2XL pool which will give west instant results instead of waiting for 2XL
node to finish sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-17 13:39:33 -05:00
Martí Bolívar 5d90ecd4ff tests: enable coverage testing for plain 'tox'
Always get coverage testing.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-01-17 17:14:36 +01:00
Martí Bolívar 237d4551c8 packaging: west is no longer a namespace package
We used to require the use of namespace packages, because west was
split into a bootstrapper and per-installation clone. That hasn't been
true since 0.6.0, so stop treating west like a namespace package.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-01-17 17:14:36 +01:00
Martí Bolívar 243545f8e8 require python 3.6+, update CI container
West 0.7.0 will require Python 3.6, just like Zephyr 2.2 will.

Move to the zephyrproject-rtos/ci container which contains this
Python. This has the ancillary benefit of making this test environment
the same as Zephyr's.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2019-12-20 16:36:05 -08:00
Marti Bolivar 33a8b0d62d Require setuptools >= 40.1.0
This is needed for find_namespace_packages. Make sure CI upgrades it
as well; the default shippable container doesn't meet the requirement.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-07-23 11:02:55 +02:00
Marti Bolivar fdb5fd127d .shippable.yml: upgrade pip to avoid 3.4 shippable failure
A tox dependency (pluggy) is depending on pathlib2 for python 3.4
only. The version of pip available in the VM (7.x series) is too old
to support "install this only on this version of Python", causing a
failure due to a missing dependency.

"Fix" that by upgrading pip.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-06-07 11:37:48 +02: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 166ed2457e Import all west modules from west.
We are getting user feedback about missing dependencies (like
"commands" and "log") that are actually imports of internal west
modules by those names.

We've been playing games with the python path to omit typing "west",
but this always caused inconsistency (as the bootstrapper version is
imported as west._bootstrap.version) and now it's causing outright
user confusion.

Let's just be consistent and import everything as west.xxx.

Fixes #57.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-01 15:12:54 -06:00
Marti Bolivar d671e63245 Decouple testing from setup.py, fixing sdists
Remove support for python setup.py test in favor of an
environment-variable based approach. Add Windows instructions as well.

With this patch, west can now be installed from a setuptools source
distribution (sdist), e.g. with "pip3 install west-0.1.99.tar.gz".

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-09-24 00:34:22 +02:00
Ulf Magnusson f8bd521dea Add self-update for West and the manifest
The self-update mechanism checks the West and manifest repositories in
west/ for upstream changes and rebases them to the latest version if any
are found.

'west fetch' and 'west pull' run a self-update before fetching any
project data. It probably makes sense to always work with the latest
version of West and the manifest there. The self-update can be
suppressed with --no-update.

There's also a 'west update' command for manually updating West and/or
the manifest.

West automatically restarts itself after a self-update, before running
any commands or parsing the manifest. This makes it safe to add a new
feature to West and immediately start using it in the manifest.

The restarting is done with a plain exec(3). Getting this to work
required a few changes:

 - West now uses absolute instead of relative imports, to make it
   possible to execute src/west/main.py directly. This also makes it a
   bit simpler to work on West. Relative imports seem to be discouraged
   when googling around a bit.

   __init__.py was removed from src/west. West is more of an application
   than a package now (though it uses some packages internally).

 - The internal 'cmd' package was renamed to 'commands', to avoid
   clashing with a module in the Python standard library.

   'runner' was renamed to 'runners' as well, for consistency.

The tests now have to be run from the West repository root with
'PYTHONPATH=src/west pytest'. The previous testing setup "just working"
relied on having run 'pip3 install -e .' first, which happened to add
src/west to the path due to the bootstrap script being there.

__init__.py was removed from the test directories as well. Packages
mostly make sense for tests if there are naming collisions, and naming
collisions will be obvious if packages aren't used.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-21 16:50:54 -06: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