Skip to content

Commit

Permalink
Add ability to run e2e tests on top of nightly release
Browse files Browse the repository at this point in the history
Extend release tag annotation check in the TestTaskRunFailure test to cover
also nightly release builds.

Signed-off-by: Yulia Gaponenko <[email protected]>
  • Loading branch information
barthy1 committed Mar 23, 2021
1 parent 0593c7b commit bc1c4c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/taskrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package test

import (
"context"
"regexp"
"strings"
"testing"

Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit bc1c4c3

Please sign in to comment.