From 4cb3d1c7d8591b527f878592324c72d8f8ef6838 Mon Sep 17 00:00:00 2001
From: iamashwin99 <ashwin-kumar.karnad@mpsd.mpg.de>
Date: Wed, 7 Jun 2023 14:40:51 +0200
Subject: [PATCH] add new test to run installer twice

This is to ensure that running the same command twice dosent lead to unexpected behaviour
---
 tests.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tests.py b/tests.py
index 1669042..5ca3035 100644
--- a/tests.py
+++ b/tests.py
@@ -268,6 +268,8 @@ def test_install_environment_zlib():
         )
     with open(setup_file, "w") as f:
         f.write(lines)
+
+
     # install global_generic toolchain
     mod.install_environment(
         mpsd_release=mpsd_release_to_test,
@@ -316,6 +318,24 @@ def test_install_environment_zlib():
         assert "zlib" in lines
 
 
+    # install again to ensure that 
+    # commands that skip creation of folders when 
+    # they are already present works as expected
+    mod.install_environment(
+        mpsd_release=mpsd_release_to_test,
+        toolchains=[toolchain_to_test],
+        script_dir=script_dir,
+        enable_build_cache=False,
+    )
+    build_log = list(
+        (release_base_dir / "logs").glob(
+            f"{mpsd_release_to_test}_{mpsd_microarch}_*_install.log"
+        )
+    )
+    assert len(build_log) > 1
+
+
+
 def test_metadata_logging(tmp_path):
     """Test that metadata is logged and read correctly."""
     # Test that the metadata is logged correctly
-- 
GitLab