Skip to content

Commit 3ec4348

Browse files
Test
Signed-off-by: M Sajid Mansoori <[email protected]>
1 parent c8baf28 commit 3ec4348

File tree

2 files changed

+42
-6
lines changed

2 files changed

+42
-6
lines changed

.github/workflows/upgrade-ci.yml

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ jobs:
4242
fi
4343
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
4444
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
45+
- name: Installing oc binary
46+
shell: bash
47+
run: |
48+
if command -v oc >/dev/null 2>&1; then
49+
echo "oc is already installed...yay"
50+
exit 0
51+
fi
52+
OC_VERSION=$(curl -s https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/release.txt | grep 'Name:' | awk '{print $2}')
53+
curl -LO "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OC_VERSION}/openshift-client-linux.tar.gz"
54+
tar -xzf openshift-client-linux.tar.gz oc
55+
sudo mv oc /usr/local/bin/oc
56+
oc version --client
4557
4658
- name: Install opm cli
4759
shell: bash
@@ -83,12 +95,20 @@ jobs:
8395

8496
- name: Set preupgrade konveyor value
8597
run: |
86-
konveyor_version=$(kubectl get csv -n konveyor-tackle -o=custom-columns=:spec.version | head -n 1 | tr -d '[:space:]')
98+
konveyor_version=$(kubectl get csv -n konveyor-tackle -o=custom-columns=:spec.version | head -n 2 | tr -d '[:space:]')
8799
echo "mtaVersion=$konveyor_version" >> $GITHUB_ENV
100+
echo "Konveyor version: $konveyor_version"
101+
102+
- name: Display konveyor version for confirmation
103+
run: |
104+
echo "Confirming konveyor version from environment variable: $mtaVersion"
105+
echo "Environment variable mtaVersion value: ${{ env.mtaVersion }}"
88106
89107
- name: Use mtaVersion
90108
run: echo "Konveyor version is $mtaVersion"
91109

110+
111+
92112
- name: Check pod status
93113
run: kubectl get pods -n konveyor-tackle
94114

@@ -118,12 +138,23 @@ jobs:
118138
- name: Install NPM
119139
run: npm install .
120140

141+
- name: Set Keycloak admin password and git credentials
142+
run: |
143+
keycloak_password=$(kubectl get secret tackle-keycloak-sso -n konveyor-tackle -o=jsonpath='{.data.admin-password}' | base64 -d)
144+
echo "cypress_keycloakAdminPassword=$keycloak_password" >> $GITHUB_ENV
145+
121146
- name: Run cypress login test
122147
run: npx cypress run --spec "cypress/e2e/tests/login.test.ts" --env user="admin",pass="password",tackleUrl=${{ env.CYPRESS_tackleUrl }}
123148

124149
- name: Run Preupgrade test cases
125150
run: |
126-
CYPRESS_INCLUDE_TAGS=@pre-upgrade npx cypress run --spec cypress/e2e/tests/upgrade/create_upgrade_data.test.ts --env user=admin,pass=Dog8code,tackleUrl=${{ env.CYPRESS_tackleUrl }}
151+
CYPRESS_INCLUDE_TAGS=@pre-upgrade npx cypress run --spec cypress/e2e/tests/upgrade/create_upgrade_data.test.ts --env user=admin,pass=Dog8code,tackleUrl=${{ env.CYPRESS_tackleUrl }},git_user=${{ secrets.KONVEYOR_GIT_USER }},git_password=${{ secrets.KONVEYOR_GIT_PASSWORD }}
152+
153+
- uses: actions/upload-artifact@v4
154+
if: failure()
155+
with:
156+
name: minikube-tests-screenshots
157+
path: /home/runner/work/tackle-ui-tests/tackle-ui-tests/cypress/screenshots/
127158

128159
- name: Checkout to initial branch
129160
run: git checkout $INIT_BRANCH
@@ -139,9 +170,14 @@ jobs:
139170

140171
- name: Set postupgrade konveyor value
141172
run: |
142-
konveyor_version=$(kubectl get csv -n konveyor-tackle -o=custom-columns=:spec.version | head -n 1 | tr -d '[:space:]')
173+
konveyor_version=$(kubectl get csv -n konveyor-tackle -o=custom-columns=:spec.version | head -n 2 | tr -d '[:space:]')
143174
echo "mtaVersion=$konveyor_version" >> $GITHUB_ENV
144175
176+
- name: Set Keycloak admin password and git credentials (post-upgrade)
177+
run: |
178+
keycloak_password=$(kubectl get secret tackle-keycloak-sso -n konveyor-tackle -o=jsonpath='{.data.admin-password}' | base64 -d)
179+
echo "cypress_keycloakAdminPassword=$keycloak_password" >> $GITHUB_ENV
180+
145181
- name: Use mtaVersion
146182
run: echo "Konveyor version is $mtaVersion"
147183

@@ -151,10 +187,10 @@ jobs:
151187

152188
- name: Run Post upgrade test cases
153189
run: |
154-
CYPRESS_INCLUDE_TAGS=@post-upgrade npx cypress run --spec **/*.test.ts --env user=admin,pass=Dog8code,tackleUrl=${{ env.CYPRESS_tackleUrl }}
190+
CYPRESS_INCLUDE_TAGS=@post-upgrade npx cypress run --spec cypress/e2e/tests/upgrade/after_upgrade.test.ts --env user=admin,pass=Dog8code,tackleUrl=${{ env.CYPRESS_tackleUrl }},git_user=${{ secrets.KONVEYOR_GIT_USER }},git_password=${{ secrets.KONVEYOR_GIT_PASSWORD }}
155191
156192
- uses: actions/upload-artifact@v4
157193
if: failure()
158194
with:
159195
name: minikube-tests-screenshots
160-
path: tackle-ui-tests/cypress/screenshots
196+
path: /home/runner/work/tackle-ui-tests/tackle-ui-tests/cypress/screenshots/

hack/install-postupgrade-konveyor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ kubectl patch sub konveyor-operator -n konveyor-tackle --type=merge -p "{\"spec\
1414

1515
echo "Patching installplan for konveyor..."
1616

17-
kubectl patch ip $(kubectl get ip -n "${NAMESPACE}" | egrep "$POSTUPGRADE_VERSION"|awk '{print $1}') -n "${NAMESPACE}" --type merge --patch '{"spec":{"approved":true}}'
17+
kubectl patch installplan $(kubectl get installplan -n "${NAMESPACE}" | egrep "$POSTUPGRADE_VERSION"|awk '{print $1}') -n "${NAMESPACE}" --type merge --patch '{"spec":{"approved":true}}'
1818

1919
kubectl wait --namespace "${NAMESPACE}" --for=condition=Successful --timeout=600s tackles.tackle.konveyor.io/tackle
2020

0 commit comments

Comments
 (0)