From 31f7bd9e743a5cf38ace7d56318c86458d6611c0 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Sun, 7 Jun 2020 22:52:12 +0200 Subject: [PATCH] image-tests: skip tests if the test case cannot be opened Schutzbot currently runs all the same tests an all arches/distro combinations. This will not work as we introduce image types only on some distro/arches. In the future we should make the image-test binary more clever, so Schutzbot won't have to tell it which cases to run at all. For now, simply don't fail if the specified test-case does not exist. Signed-off-by: Tom Gundersen --- cmd/osbuild-image-tests/main_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/osbuild-image-tests/main_test.go b/cmd/osbuild-image-tests/main_test.go index 1228dbdbd..80e5bfdb0 100644 --- a/cmd/osbuild-image-tests/main_test.go +++ b/cmd/osbuild-image-tests/main_test.go @@ -399,7 +399,9 @@ func runTests(t *testing.T, cases []string) { for _, path := range cases { t.Run(path, func(t *testing.T) { f, err := os.Open(path) - require.NoErrorf(t, err, "%s: cannot open test case: %#v", path, err) + if err != nil { + t.Skipf("%s: cannot open test case: %#v", path, err) + } var testcase testcaseStruct err = json.NewDecoder(f).Decode(&testcase)