Commit graph

13 commits

Author SHA1 Message Date
Newbyte
871a3128d8
docs, pmb: Add missing copyright headers (MR 2516)
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.
2025-01-02 16:45:03 +01:00
Caleb Connolly
bb12609753
test: conftest: require_programs() automatically (MR 2483)
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>
2024-11-29 16:50:04 +01:00
Caleb Connolly
39a696ceed
test: conftest: adjust pmaports fixture (MR 2477) (MR 2483)
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>
2024-11-29 16:50:04 +01:00
Oliver Smith
c8763a630b
Revert "test: conftest: adjust pmaports fixture (MR 2477)" (MR 2482)
This caused a regression in CI tests.
This reverts commit b888ddde30.

Related: issue 2497
2024-11-10 17:22:55 +01:00
Caleb Connolly
b888ddde30
test: conftest: adjust pmaports fixture (MR 2477)
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>
2024-11-08 01:57:26 +01:00
Caleb Connolly
29b9a57cd6
test: conftest: describe paramaterize for config_file (MR 2477)
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-11-08 01:57:26 +01:00
Caleb Connolly
b9354d3ccd
test: parse: add test_deviceinfo (MR 2453)
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>
2024-10-30 23:14:01 +01:00
Oliver Smith
9dfa89c58c
Use pmbootstrap_v3.cfg as config file (MR 2350)
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.
2024-07-10 20:06:25 +02:00
Hugo Osvaldo Barrera
e421bb2d41
Auto-format codebase with ruff (MR 2325)
See: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2324
Closes: https://gitlab.com/postmarketOS/pmbootstrap/-/merge_requests/2278
2024-06-23 15:40:13 +02:00
Caleb Connolly
d75f1cf525
tests: add a test for packages_get_locally_built_apks() (MR 2252)
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:41 +02:00
Caleb Connolly
3f11fa2500
tests: basic pkgrepo tests, clone pmaports (MR 2252)
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-23 12:38:41 +02:00
Caleb Connolly
ca722b499e
tests: add tests for Arch and Chroot types (MR 2252)
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>
2024-06-23 12:38:41 +02:00
Caleb Connolly
ff86792fb6
test: add pytest and test config load/migrate (MR 2252)
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>
2024-06-23 12:38:40 +02:00