osbuild: store outputs in objectstore
Treat outputs like we treat trees: store them in the object store. This simplifies using osbuild and allows returning a cached version if one is available. This makes the `--output` parameter redundant. Remove it.
This commit is contained in:
parent
cb173f7d3c
commit
83475cc9f4
9 changed files with 27 additions and 34 deletions
|
|
@ -5,6 +5,7 @@ from typing import List, Callable, Any
|
|||
from . import evaluate_test, rel_path
|
||||
from .build import run_osbuild
|
||||
from .run import run_image, extract_image
|
||||
from test.integration_tests.config import *
|
||||
|
||||
|
||||
class IntegrationTestType(Enum):
|
||||
|
|
@ -22,18 +23,18 @@ class IntegrationTestCase:
|
|||
type: IntegrationTestType
|
||||
|
||||
def run(self):
|
||||
run_osbuild(rel_path(f"pipelines/{self.pipeline}"), self.build_pipeline)
|
||||
tree_id, output_id = run_osbuild(rel_path(f"pipelines/{self.pipeline}"), self.build_pipeline)
|
||||
if self.type == IntegrationTestType.BOOT_WITH_QEMU:
|
||||
self.run_and_test()
|
||||
self.run_and_test(output_id)
|
||||
else:
|
||||
self.extract_and_test()
|
||||
self.extract_and_test(output_id)
|
||||
|
||||
def run_and_test(self):
|
||||
r = run_image(self.output_image)
|
||||
def run_and_test(self, output_id):
|
||||
r = run_image(f"{OBJECTS}/refs/{output_id}/{self.output_image}")
|
||||
for test in self.test_cases:
|
||||
evaluate_test(test, r.stdout)
|
||||
|
||||
def extract_and_test(self):
|
||||
with extract_image(self.output_image) as fstree:
|
||||
def extract_and_test(self, output_id):
|
||||
with extract_image(f"{OBJECTS}/refs/{output_id}/{self.output_image}") as fstree:
|
||||
for test in self.test_cases:
|
||||
evaluate_test(lambda: test(fstree), name=test.__name__)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue