forked from Mirror/pmbootstrap
Cache which packages have been built (#972)
Fixes #968: Dependency calculation took a long time for `postmarketos-ui-plasma-mobile`
This commit is contained in:
parent
ddabc69b8d
commit
96eaf481d1
4 changed files with 35 additions and 1 deletions
|
@ -75,6 +75,14 @@ def args_patched(monkeypatch, argv):
|
|||
return pmb.parse.arguments()
|
||||
|
||||
|
||||
def test_skip_already_built(args):
|
||||
func = pmb.build._package.skip_already_built
|
||||
assert args.cache["built"] == {}
|
||||
assert func(args, "test-package", "armhf") is False
|
||||
assert args.cache["built"] == {"armhf": ["test-package"]}
|
||||
assert func(args, "test-package", "armhf") is True
|
||||
|
||||
|
||||
def test_get_apkbuild(args):
|
||||
func = pmb.build._package.get_apkbuild
|
||||
|
||||
|
@ -256,9 +264,11 @@ def test_package(args):
|
|||
assert pmb.build.package(args, "hello-world", force=True)
|
||||
|
||||
# Package exists
|
||||
args.cache["built"] = {}
|
||||
assert pmb.build.package(args, "hello-world") is None
|
||||
|
||||
# Force building again
|
||||
args.cache["built"] = {}
|
||||
assert pmb.build.package(args, "hello-world", force=True)
|
||||
|
||||
# Build for another architecture
|
||||
|
@ -293,6 +303,7 @@ def test_build_depends_high_level(args, monkeypatch):
|
|||
# Remove hello-world
|
||||
pmb.helpers.run.root(args, ["rm", output_hello_outside])
|
||||
pmb.build.index_repo(args, args.arch_native)
|
||||
args.cache["built"] = {}
|
||||
|
||||
# Ask to build the wrapper. It should not build the wrapper (it exists, not
|
||||
# using force), but build/update its missing dependency "hello-world"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue