fix flake and use operatorhub to install EDB (#6004)

* fix flake

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fix flake

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* check if namespace is created

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* check if namespace without sercice is created

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
This commit is contained in:
Anand Kumar Singh
2022-08-29 20:56:57 +05:30
committed by GitHub
parent 0a83f1d899
commit 39b8c7e4c2
7 changed files with 34 additions and 8 deletions

View File

@@ -52,7 +52,7 @@ function Run-Test {
$GOCACHE="$(Get-Location)\.gocache"
mkdir $GOCACHE
[Environment]::SetEnvironmentVariable("GOCACHE", "$GOCACHE")
[Environment]::SetEnvironmentVariable("TEST_EXEC_NODES", "$TEST_EXEC_NODES")
[Environment]::SetEnvironmentVariable("SKIP_USER_LOGIN_TESTS","true")
Shout "Login IBMcloud"
@@ -91,6 +91,7 @@ $IBM_OPENSHIFT_ENDPOINT=$args[3]
$LOGFILE=$args[4]
$REPO=$args[5]
$CLUSTER_ID=$args[6]
$TEST_EXEC_NODES=$args[7]
Shout "Args Recived"
# Pre test cleanup

View File

@@ -13,7 +13,8 @@ export REPO=${REPO:-"https://github.com/redhat-developer/odo"}
sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no ./.ibm/pipelines/windows-test-script.ps1 Administrator@$WINDOWS_IP:/tmp/windows-test-script.ps1
#execute test from the test script
sshpass -p $WINDOWS_PASSWORD ssh Administrator@$WINDOWS_IP -o StrictHostKeyChecking=no powershell /tmp/windows-test-script.ps1 "${GIT_PR_NUMBER}" "${BUILD_NUMBER}" "${API_KEY_QE}" "${IBM_OPENSHIFT_ENDPOINT}" "${LOGFILE}" "${REPO}" "${WINDOWS_IP}" "${CLUSTER_ID}"
export TEST_EXEC_NODES=${TEST_EXEC_NODES:-"16"}
sshpass -p $WINDOWS_PASSWORD ssh Administrator@$WINDOWS_IP -o StrictHostKeyChecking=no powershell /tmp/windows-test-script.ps1 "${GIT_PR_NUMBER}" "${BUILD_NUMBER}" "${API_KEY_QE}" "${IBM_OPENSHIFT_ENDPOINT}" "${LOGFILE}" "${REPO}" "${WINDOWS_IP}" "${CLUSTER_ID}" "${TEST_EXEC_NODES}"
RESULT=$?
echo "RESULT: $RESULT"

View File

@@ -45,6 +45,8 @@ export ODO_LOG_LEVEL ?= 4
# To enable verbosity export or set env GINKGO_TEST_ARGS like "GINKGO_TEST_ARGS=-v"
UNIT_TEST_ARGS ?=
export ARTIFACT_DIR ?= .
GINKGO_FLAGS_ALL = $(GINKGO_TEST_ARGS) --randomize-all --slow-spec-threshold=$(SLOW_SPEC_THRESHOLD) -timeout $(TIMEOUT) --no-color
# Flags for tests that must not be run in parallel.

View File

@@ -1,6 +1,24 @@
#!/bin/bash
set -x
install_sourceCatalog(){
$1 create -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: operatorhubio-catalog
namespace: openshift-marketplace
spec:
sourceType: grpc
image: quay.io/operatorhubio/catalog:latest
displayName: Community Operators
publisher: OperatorHub.io
updateStrategy:
registryPoll:
interval: 60m
EOF
}
install_postgres_operator(){
$1 create -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
@@ -73,8 +91,11 @@ elif [ "$KUBERNETES" == "true" ]; then
# install "service-binding-operator" using "kubectl" in "operators" namespace; use "operatorhubio-catalog" catalog source from "olm" namespace
install_service_binding_operator kubectl operators service-binding-operator operatorhubio-catalog olm
else
#install operatorhub.io sourceCatalog
install_sourceCatalog oc
# install "cloud-native-postgresql" using "oc" in "openshift-operators" namespace; use "certified-operators" catalog source from "openshift-marketplace" namespace
install_postgres_operator oc openshift-operators certified-operators openshift-marketplace
install_postgres_operator oc openshift-operators operatorhubio-catalog openshift-marketplace
# install "rh-service-binding-operator" using "oc" in "openshift-operators" namespace; use "redhat-operators" catalog source from "openshift-marketplace" namespace
install_service_binding_operator oc openshift-operators rh-service-binding-operator redhat-operators openshift-marketplace

View File

@@ -55,5 +55,4 @@ else
fi
fi
oc logout

View File

@@ -326,7 +326,7 @@ func (oc OcRunner) CreateAndSetRandNamespaceProjectOfLength(i int) string {
func (oc OcRunner) createAndSetRandNamespaceProject(projectName string) string {
fmt.Fprintf(GinkgoWriter, "Creating a new project: %s\n", projectName)
session := Cmd("odo", "create", "project", projectName, "-w", "-v4").ShouldPass().Out()
session := Cmd(oc.path, "new-project", projectName).ShouldPass().Out()
Expect(session).To(ContainSubstring(projectName))
oc.addConfigMapForCleanup(projectName)
return projectName

View File

@@ -228,8 +228,9 @@ var _ = Describe("odo add binding interactive command tests", func() {
addBindableKindInOtherNs := commonVar.CliRunner.Run("-n", otherNS, "apply", "-f",
helper.GetExamplePath("manifests", "bindablekind-instance.yaml"))
Expect(addBindableKindInOtherNs.ExitCode()).To(BeEquivalentTo(0))
nsWithNoService = commonVar.CliRunner.CreateAndSetRandNamespaceProject()
Expect(commonVar.CliRunner.HasNamespaceProject(nsWithNoService)).Should(Equal(true))
Expect(commonVar.CliRunner.HasNamespaceProject(otherNS)).Should(Equal(true))
commonVar.CliRunner.SetProject(commonVar.Project)
})
@@ -559,8 +560,9 @@ var _ = Describe("odo add binding interactive command tests", func() {
addBindableKindInOtherNs := commonVar.CliRunner.Run("-n", otherNS, "apply", "-f",
helper.GetExamplePath("manifests", "bindablekind-instance.yaml"))
Expect(addBindableKindInOtherNs.ExitCode()).To(BeEquivalentTo(0))
nsWithNoService = commonVar.CliRunner.CreateAndSetRandNamespaceProject()
Expect(commonVar.CliRunner.HasNamespaceProject(nsWithNoService)).Should(Equal(true))
Expect(commonVar.CliRunner.HasNamespaceProject(otherNS)).Should(Equal(true))
commonVar.CliRunner.SetProject(commonVar.Project)
})