Skip to content

Commit

Permalink
fix flake and use operatorhub to install EDB (redhat-developer#6004)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
anandrkskd authored and cdrage committed Aug 31, 2022
1 parent 58a4662 commit 6c3293f
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .ibm/pipelines/windows-test-script.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ function Run-Test {

$GOCACHE="$(Get-Location)\.gocache"
mkdir $GOCACHE
[Environment]::SetEnvironmentVariable("GOCACHE", "$GOCACHE")

[Environment]::SetEnvironmentVariable("GOCACHE", "$GOCACHE")
[Environment]::SetEnvironmentVariable("TEST_EXEC_NODES", "$TEST_EXEC_NODES")
[Environment]::SetEnvironmentVariable("SKIP_USER_LOGIN_TESTS","true")

Shout "Login IBMcloud"
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .ibm/pipelines/windows-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
23 changes: 22 additions & 1 deletion scripts/configure-cluster/common/setup-operators.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion scripts/openshiftci-presubmit-all-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,4 @@ else
fi
fi


oc logout
2 changes: 1 addition & 1 deletion tests/helper/helper_oc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/interactive_add_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down Expand Up @@ -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)
})
Expand Down

0 comments on commit 6c3293f

Please sign in to comment.