I tried my best to get the right author based on git commit history, but
in the case of code being moved from one file to make another I might
have gotten something wrong.
Pmbootstrap finds all its host dependencies during init, ensure we do
that for pytest too.
Adapt require_programs() to use subprocess directly rather than have to
solve the weird dependency chain of pmb.helpers.run which depends on the
global context being initialised before it's usable.
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
make sure that calls to get_upstream_remote() will succeed by setting
pmb.config.git_repos() for the entire run. This might pollute some other
tests...
TODO: make less things depend on pmaports being cloned...
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
make sure that calls to get_upstream_remote() will succeed by setting
pmb.config.git_repos() for the entire run. This might pollute some other
tests...
TODO: make less things depend on pmaports being cloned...
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Write some basic parser tests for deviceinfo. The parser is quite basic
so there isn't much to test yet. Expecting this to gain features as we
look at e.g. making the parser the "source of truth" for the deviceinfo
format.
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Using pmbootstrap v3 with the old config can cause problems, for example
when having $WORK in the pmaports dir instead of the actual work path.
This is not supported anymore by v3 to reduce complexity. The format of
how mirrors are stored in the config also has changed.
Use a separate config file, so users can go back from v3 to 2.3.x if
they need to (for figuring out a regression) and so users won't run into
bugs when moving from 2.3.x to v3.
Add some exhaustive unit testing to validate that these types behave as
expected.
And fix a few bugs uncovered by the tests.
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
re-introduce pytest, add a conftest.py with some useful fixtures and
basic tests for config loading.
This just checks that we can load the config and migrate it from the old
2.3.x format to the new 3.0 format with the new mirrors section.
Testing anything that requires args or Context should probably wait
until we can properly model state (since global state like in
get_context() really doesn't jive with pytest).
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>