Skip to content

Commit

Permalink
integration_tests: add the integration tests for task #95
Browse files Browse the repository at this point in the history
Added tests are focused on the following issue:
#95

Signed-off-by: Mykhailo Androsiuk <[email protected]>
  • Loading branch information
Mykhailo Androsiuk committed Jan 17, 2024
1 parent cab499c commit d05c70e
Show file tree
Hide file tree
Showing 14 changed files with 4,694 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import subprocess
import pytest
import os
import tempfile


@pytest.mark.integration
def test_negative_tar_archive_missing():
script_path = os.path.abspath(__file__)
script_dir_path = os.path.dirname(script_path)
yaml_file = os.path.join(script_dir_path, "resources/test_negative_tar_archive_missing.yaml")
archive_name = "rcar-prebuilts-graphics-xt-doma.tar.gz"

with tempfile.TemporaryDirectory(dir=script_dir_path) as tmp_dir:

result = subprocess.run(["python", "../../../../../moulin.py", yaml_file, "--ENABLE_ANDROID", "yes",
"--ANDROID_PREBUILT_DDK", "yes"],
cwd=tmp_dir,
stderr=subprocess.PIPE,
text=True)

assert result.returncode == 0, ("The return code is equal to '0'")

result = subprocess.run(["ninja", ".stamps/rcar-prebuilts-graphics-xt-doma.tar.gz.stamp"],
cwd=tmp_dir,
stderr=subprocess.PIPE,
text=True)

assert result.returncode != 0, ("The return code is not equal to '0'")
assert archive_name in result.stderr, "The expected warning message is missing"
assert "missing and no known rule to make it" in result.stderr, "The expected warning message is missing"


if __name__ == "__main__":
pytest.main([__file__])
Loading

0 comments on commit d05c70e

Please sign in to comment.