Skip to content

Commit

Permalink
Makefile target test-smoke
Browse files Browse the repository at this point in the history
Signed-off-by: Henri Rosten <[email protected]>
  • Loading branch information
henrirosten committed Jan 3, 2025
1 parent 454e7a3 commit 2d44985
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ test-ci: check ## Run CI tests
check: clean
nix --extra-experimental-features 'flakes nix-command' flake check

test-smoke: ## Run smoke tests
pytest -n auto -vx -k "not slow" tests/
$(call target_success,$@)

test: ## Run tests
pytest -n auto -vx tests/
$(call target_success,$@)
Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
pythonpath = .
markers =
skip_in_ci: indicates test should not be run in ci.
slow: indicates a slow tests.
8 changes: 8 additions & 0 deletions tests/test_sbomnix.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def test_sbomnix_type_runtime():
validate_json(out_path_spdx.as_posix(), spdx_schema_path)


@pytest.mark.slow
def test_sbomnix_type_buildtime():
"""Test sbomnix generates valid CycloneDX json with buildtime dependencies"""
out_path_cdx = TEST_WORK_DIR / "sbom_cdx_test.json"
Expand Down Expand Up @@ -301,6 +302,7 @@ def test_compare_deps_runtime():
)


@pytest.mark.slow
def test_compare_deps_buildtime():
"""Compare nixgraph vs sbom buildtime dependencies"""
graph_csv_out = TEST_WORK_DIR / "graph.csv"
Expand Down Expand Up @@ -339,6 +341,7 @@ def test_compare_deps_buildtime():
)


@pytest.mark.slow
def test_compare_subsequent_cdx_sboms():
"""Compare two sbomnix runs with same target produce the same cdx sbom"""
out_path_cdx_1 = TEST_WORK_DIR / "sbom_cdx_test_1.json"
Expand Down Expand Up @@ -374,6 +377,7 @@ def test_compare_subsequent_cdx_sboms():
)


@pytest.mark.slow
def test_compare_subsequent_spdx_sboms():
"""Compare two sbomnix runs with same target produce the same spdx sbom"""
out_path_spdx_1 = TEST_WORK_DIR / "sbom_spdx_test_1.json"
Expand Down Expand Up @@ -409,6 +413,7 @@ def test_compare_subsequent_spdx_sboms():
)


@pytest.mark.slow
def test_compare_spdx_and_cdx_sboms():
"""Compare spdx and cdx sboms from the same sbomnix invocation"""
out_path_spdx = TEST_WORK_DIR / "sbom_spdx_test.json"
Expand Down Expand Up @@ -531,6 +536,7 @@ def test_repology_cli_help():
_run_python_script([REPOLOGY_CLI, "-h"])


@pytest.mark.slow
def test_repology_cli_sbom():
"""Test repology_cli with SBOM as input"""
out_path_cdx = TEST_WORK_DIR / "sbom_cdx_test.json"
Expand Down Expand Up @@ -569,6 +575,7 @@ def test_nix_outdated_help():
_run_python_script([NIX_OUTDATED, "-h"])


@pytest.mark.slow
def test_nix_outdated_result():
"""Test nix_outdated with TEST_NIX_RESULT as input"""
out_path_nix_outdated = TEST_WORK_DIR / "nix_outdated.csv"
Expand All @@ -593,6 +600,7 @@ def test_nixmeta_help():
_run_python_script([NIXMETA, "-h"])


@pytest.mark.slow
def test_nixmeta_sbomnix_flakeref():
"""Test nixmeta with sbomnix flakeref"""
out_path = TEST_WORK_DIR / "nixmeta.csv"
Expand Down

0 comments on commit 2d44985

Please sign in to comment.