From 697387f5861801edb99f2e1ea169fc37dd0ebc7b Mon Sep 17 00:00:00 2001
From: iamashwin99 <ashwin-kumar.karnad@mpsd.mpg.de>
Date: Fri, 11 Aug 2023 16:18:23 +0200
Subject: [PATCH] test remove_build_log and its contents

---
 tests/test_mpsd_software.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/test_mpsd_software.py b/tests/test_mpsd_software.py
index b03a2e5..d119fcb 100644
--- a/tests/test_mpsd_software.py
+++ b/tests/test_mpsd_software.py
@@ -789,6 +789,16 @@ def test_remove_package_sets(tmp_path, simple_toolchain):
         shell=True,
         check=True,
     )
+    # check that the logs directory contains a build log for remove cmd
+    # dev-23a_zen3_2023-08-11T15-55-54_BUILD_toolchain2_remove.log
+    logs_dir = tmp_path / release_to_test / "logs"
+    # remove_build_log is the last log file in the list
+    remove_build_log = sorted(list(logs_dir.iterdir()))[-1]
+    assert "toolchain2_remove.log" in remove_build_log.name
+    with open(remove_build_log, "r") as f:
+        logs = f.read()
+        assert "==> Will not uninstall zlib@" in logs
+        assert "==> Successfully removed environment 'toolchain2'" in logs
 
 
 def test_remove_global_package_sets():
-- 
GitLab