Skip to content

Commit

Permalink
fix: adapt artifacts pathes
Browse files Browse the repository at this point in the history
  • Loading branch information
JuReMq committed Apr 16, 2024
1 parent d5d3746 commit 66d27fd
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/spl_core/test_utils/base_variant_test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def expected_test_artifacts(self) -> List[Path]:

@property
def expected_variant_report_artifacts(self) -> List[Path]:
return [Path("reports/reports/index.html")]
return [Path("reports/html/index.html")]

@property
def expected_component_report_artifacts(self) -> List[Path]:
Expand All @@ -39,23 +39,29 @@ def expected_component_report_artifacts(self) -> List[Path]:
Path("coverage/index.html"),
]

def assert_artifact_exists(self, dir: Path, artifact: Path) -> None:
if artifact.is_absolute():
assert artifact.exists(), f"Artifact {artifact} does not exist" # noqa: S101
else:
assert Path.joinpath(dir, artifact).exists(), f"Artifact {Path.joinpath(dir, artifact)} does not exist" # noqa: S101

def test_build(self) -> None:
spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="prod")
assert 0 == spl_build.execute(target="all") # noqa: S101
for artifact in self.expected_build_artifacts:
assert artifact.exists() or Path.joinpath(spl_build.build_dir, artifact).exists() # noqa: S101
self.assert_artifact_exists(dir=Path.joinpath(spl_build.build_dir, "reports", "html"), artifact=artifact)

def test_unittest(self) -> None:
spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="test")
assert 0 == spl_build.execute(target="unittests") # noqa: S101
for artifact in self.expected_test_artifacts:
assert artifact.exists() # noqa: S101
self.assert_artifact_exists(dir=spl_build.build_dir, artifact=artifact)

def test_reports(self) -> None:
spl_build: SplBuild = SplBuild(variant=self.variant, build_kit="test")
assert 0 == spl_build.execute(target="all") # noqa: S101
assert 0 == spl_build.execute(target="all") # noqa: S101
for artifact in self.expected_variant_report_artifacts:
assert Path.joinpath(spl_build.build_dir, artifact).exists() # noqa: S101
self.assert_artifact_exists(dir=spl_build.build_dir, artifact=artifact)
for component in self.component_paths:
for artifact in self.expected_component_report_artifacts:
assert Path.joinpath(spl_build.build_dir, component, artifact).exists() # noqa: S101
self.assert_artifact_exists(dir=Path.joinpath(spl_build.build_dir, "reports", "html", spl_build.build_dir, component, "reports"), artifact=artifact)

0 comments on commit 66d27fd

Please sign in to comment.