chore(CI): Fix potentially flaky tests

This commit is contained in:
Armel Soro
2024-06-28 14:41:47 +02:00
parent 92e02c5407
commit 85926ff88a
3 changed files with 7 additions and 4 deletions

View File

@@ -30,7 +30,6 @@ export KUBECONFIG=$TMP_DIR/kubeconfig
# Login as developer
oc login -u developer -p password@123 --insecure-skip-tls-verify
# Check login user name for debugging purpose
oc whoami
@@ -40,6 +39,10 @@ source ./scripts/openshiftci-config.sh
# Integration tests
make test-integration-openshift || error=true
# Login again (in case the token expires for some reason)
oc login -u developer -p password@123 --insecure-skip-tls-verify || true
oc whoami
# E2e tests
make test-e2e || error=true

View File

@@ -460,6 +460,7 @@ var _ = Describe("odo dev debug command tests", func() {
for _, podman := range []bool{false, true} {
podman := podman
When("starting with Devfile with autoBuild or deployByDefault components",
Label(helper.LabelSkipOnOpenShift), // No need to repeat this test on OCP, as it is already covered on vanilla K8s
helper.LabelPodmanIf(podman, func() {
BeforeEach(func() {
helper.CopyExample(filepath.Join("source", "nodejs"), commonVar.Context)

View File

@@ -286,9 +286,8 @@ ComponentSettings:
Expect(td.Properties.CmdProperties[segment.Platform]).To(Equal("openshift"))
}
serverVersion := commonVar.CliRunner.GetVersion()
if serverVersion == "" {
Expect(td.Properties.CmdProperties[segment.PlatformVersion]).To(BeNil())
} else {
// Result may or may not be empty, because sometimes `oc version` may not return the OpenShift Server version
if serverVersion != "" {
Expect(td.Properties.CmdProperties[segment.PlatformVersion]).To(ContainSubstring(serverVersion))
}
})