west/tests/manifests
Marti Bolivar 060bd29c45 manifest: correct several design and implementation issues
The west.manifest module is not in great shape:

- Though it's possible to create a manifest from data, this still
  looks for a topdir and a manifest.path configuration option on
  disk. This is wrong and contrary to the goal that we can parse
  manifest data independently of the file system.

  You can see that this doesn't really make sense in the hacks that
  the west init implementation needs to make things work, and the fact
  that all the tests which operate on data only have to patch
  west_topdir(), etc.

- The Project definition repeatedly finds the west topdir. Even
  when this is necessary, it should only be done once, and the value
  cached and passed around.

- The ManifestProject abstraction makes several bizarre semantic
  decisions, some of which never made sense, some of which are
  just stale leftovers from when it was SpecialProject.

- The manifest_path() helper mutates the global configuration object

Add some new kwargs to the Manifest factories and constructor, which
allow the user to avoid using west_topdir() or west.configuration when
they do not want to, and propagate the new information down into
Project and ManifestProject.

This allows users to parse manifest files and data without forcing
them to be inside an actual installation (and/or to parse other
manifest files than the one currently pointed to by manifest.path), at
the cost of not having abspath or posixpath attributes in some cases.

Fix up Project by taking a new topdir kwarg and saving it in a slot.

Fix up ManifestProject so that it generally makes more sense. This now
enforces an existing requirement in the documentation that no project
can be named "manifest", as that's reserved for the manifest
repository. Fix some other thinkos as well by deprecating the revision
and url kwargs, which are SpecialProject leftovers, and taking the
path as an argument as-is, even though that means it can be None now.

I've tried to preserve backwards compatibility whenever possible,
especially in situations where the user just wants to parse the
manifest in the current west installation based on file system
searches and configuration options.

The additional kwargs to Project and ManifestProject are breaking
changes for any code which was using this module for something else,
but the lack of sense that those made before probably meant such
code didn't do anything useful, so that's okay.

This also breaks compatibility with "west list zephyr" when run
outside of the top level directory -- you need to say "west list
manifest" or give the complete relative path to zephyr now.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-30 17:32:57 -06:00
..
invalid_bad_default_remote.yml tests: flatten the hierarchy 2019-05-20 11:06:53 +02:00
invalid_duplicate_name.yml manifest: project names must be unique 2019-05-20 11:06:53 +02:00
invalid_duplicate_project_path.yml tests: flatten the hierarchy 2019-05-20 11:06:53 +02:00
invalid_empty.yml tests: flatten the hierarchy 2019-05-20 11:06:53 +02:00
invalid_ill_defined_project.yml tests: add test cases for explicit project URLs 2019-05-20 11:06:53 +02:00
invalid_ill_defined_remote.yml tests: flatten the hierarchy 2019-05-20 11:06:53 +02:00
invalid_no_project_named_manifest.yml manifest: correct several design and implementation issues 2019-08-30 17:32:57 -06:00
invalid_no_projects.yml tests: flatten the hierarchy 2019-05-20 11:06:53 +02:00
invalid_no_remotes.yml tests: add test cases for explicit project URLs 2019-05-20 11:06:53 +02:00
invalid_remote_and_url.yml tests: add test cases for explicit project URLs 2019-05-20 11:06:53 +02:00
invalid_repo_path_and_url.yml manifest: allow 'repo-path' to specify the path within a remote 2019-07-26 11:33:01 +02:00
invalid_too_flat.yml tests: flatten the hierarchy 2019-05-20 11:06:53 +02:00
invalid_west_commands_1.yml tests: flatten the hierarchy 2019-05-20 11:06:53 +02:00
invalid_west_commands_2.yml tests: flatten the hierarchy 2019-05-20 11:06:53 +02:00
invalid_west_commands_3.yml tests: flatten the hierarchy 2019-05-20 11:06:53 +02:00