From bc1c4c3cad96780107775b4e15b13ca56376be53 Mon Sep 17 00:00:00 2001 From: Yulia Gaponenko Date: Tue, 23 Mar 2021 14:52:31 +0100 Subject: [PATCH] Add ability to run e2e tests on top of nightly release Extend release tag annotation check in the TestTaskRunFailure test to cover also nightly release builds. Signed-off-by: Yulia Gaponenko --- test/taskrun_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/taskrun_test.go b/test/taskrun_test.go index 42f952d7367..af1f2626b6e 100644 --- a/test/taskrun_test.go +++ b/test/taskrun_test.go @@ -20,6 +20,7 @@ package test import ( "context" + "regexp" "strings" "testing" @@ -122,8 +123,10 @@ func TestTaskRunFailure(t *testing.T) { } releaseAnnotation, ok := taskrun.Annotations[pod.ReleaseAnnotation] - if !ok || releaseAnnotation != "devel" { - t.Fatalf("expected Taskrun to be annotated with %s=devel, got %s=%s", pod.ReleaseAnnotation, pod.ReleaseAnnotation, releaseAnnotation) + // Nightly release tag looks like v20210323-0593c7bef3 + nightlyReleaseRegexp, _ := regexp.Compile("^v[0-9]{8}-[0-9a-z]{10}$") + if !ok || !(releaseAnnotation == "devel" || nightlyReleaseRegexp.MatchString(releaseAnnotation)) { + t.Fatalf("expected Taskrun to be annotated with %s=devel or with nightly release tag, got %s=%s", pod.ReleaseAnnotation, pod.ReleaseAnnotation, releaseAnnotation) } }