Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 347944d

Browse files
committedApr 8, 2020
test(e2e): login w/ docker first to prevent failures
Login with docker at the start of the e2e test suite to prevent random failures when podman login is used first. This is a stopgap until daemonless image pulling is compatible with podman login.
1 parent da66554 commit 347944d

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed
 

‎test/e2e/e2e_suite_test.go

+19
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
package e2e_test
22

33
import (
4+
"os"
5+
"os/exec"
46
"testing"
57

68
. "github.com/onsi/ginkgo"
79
. "github.com/onsi/gomega"
810
)
911

12+
var (
13+
dockerUsername = os.Getenv("DOCKER_USERNAME")
14+
dockerPassword = os.Getenv("DOCKER_PASSWORD")
15+
)
16+
1017
func TestE2E(t *testing.T) {
1118
RegisterFailHandler(Fail)
1219
RunSpecs(t, "E2E Suite")
1320
}
21+
22+
var _ = BeforeSuite(func() {
23+
// FIXME: Since podman login doesn't work with daemonless image pulling, we need to login with docker first so podman tests don't fail.
24+
if dockerUsername == "" || dockerPassword == "" {
25+
// Test will be skipped anyway
26+
return
27+
}
28+
29+
dockerlogin := exec.Command("docker", "login", "-u", dockerUsername, "-p", dockerPassword, "quay.io")
30+
err := dockerlogin.Run()
31+
Expect(err).NotTo(HaveOccurred(), "Error logging into quay.io")
32+
})

‎test/e2e/opm_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,6 @@ func initialize() error {
160160
var _ = Describe("opm", func() {
161161
IncludeSharedSpecs := func(containerTool string) {
162162
BeforeEach(func() {
163-
dockerUsername := os.Getenv("DOCKER_USERNAME")
164-
dockerPassword := os.Getenv("DOCKER_PASSWORD")
165-
166163
if dockerUsername == "" || dockerPassword == "" {
167164
Skip("registry credentials are not available")
168165
}

0 commit comments

Comments
 (0)
Please sign in to comment.