From fca78e56010e981a073272b71c91c0d2a7e2d4cf Mon Sep 17 00:00:00 2001 From: Jasper Orschulko Date: Thu, 26 Aug 2021 14:18:16 +0200 Subject: [PATCH] for_all_repos: Fix test case An upcoming change will introduce returning non-zero status on the KAS command if the for_all_repos command fails for one of the repos defined in the kas configuration. This caused an issue with the non-git "this" repo defined in the test.yml. Signed-off-by: Jasper Orschulko [Jan: adjusted commit log to reflect different commit ordering] Signed-off-by: Jan Kiszka --- tests/test_commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_commands.py b/tests/test_commands.py index 9762025..6195bb1 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -32,7 +32,8 @@ def test_for_all_repos(changedir, tmpdir): shutil.copytree('tests/test_commands', tdir) os.chdir(tdir) kas.kas(['for-all-repos', 'test.yml', - 'git rev-parse HEAD >> %s/ref_${KAS_REPO_NAME}' % (tdir)]) + '''if [ "${KAS_REPO_NAME}" != "this" ]; then git rev-parse HEAD \ + >> %s/ref_${KAS_REPO_NAME}; fi''' % (tdir)]) with open('ref_kas_1.0', 'r') as f: assert(f.readline().strip()