Skip to content

Commit e9e83a3

Browse files
author
Jorge Solórzano
committed
chore: Update ui test cypress to 10.11.0
Signed-off-by: Jorge Solórzano <jorsol@ongres.com>
1 parent 9c1766d commit e9e83a3

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

  • stackgres-k8s/e2e/spec

stackgres-k8s/e2e/spec/ui

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ e2e_test_install() {
5252
spec:
5353
containers:
5454
- name: $CYPRESS_POD
55-
image: cypress/included:10.9.0
55+
image: cypress/included:10.11.0
5656
command: [ "sh", "-c", "while true; do sleep 300; done" ]
5757
imagePullPolicy: IfNotPresent
5858
env:
@@ -120,11 +120,11 @@ is_backup_phase() {
120120
e2e_test_values() {
121121
(
122122
cd "$UI_TESTS_RESOURCES_PATH/cypress/e2e"
123-
find -name '*.cy.js' | cut -d / -f 2-
123+
find . -name '*.cy.js' | cut -d / -f 2- | sort
124124
)
125125
}
126126

127-
e2e_test() {
127+
e2e_test() {
128128
if [ "$(uname -m)" != x86_64 ]
129129
then
130130
echo "Skipping ui test since not running in x86_64 architecture"
@@ -155,7 +155,7 @@ cypress_test(){
155155
}
156156

157157
check_index_on_not_found_resource(){
158-
RANDOM_RESOURCE="$(cat /dev/urandom | tr -dc 'a-z' | fold -w 8 | head -n 1)"
158+
RANDOM_RESOURCE="$(random_string_lowercase 8)"
159159
HTTP_STATUS="$(kubectl exec -i -n "$CLUSTER_NAMESPACE" "$CYPRESS_POD" -- curl -s -k "https://stackgres-restapi.$OPERATOR_NAMESPACE/admin/$RANDOM_RESOURCE" -X GET -LI -o /dev/null -w '%{http_code}' 2>/dev/null)"
160160

161161
assert_string_equal "200" "$HTTP_STATUS"
@@ -164,22 +164,19 @@ check_index_on_not_found_resource(){
164164

165165
if echo "$HTTP_RESPONSE" | grep -E "<meta.+index" > /dev/null
166166
then
167-
echo "SUCCESS. Returned index page on not found resource"
167+
success "Returned index page on not found resource"
168168
else
169-
echo "FAIL. Index page not returned on not found resource"
170-
return 1
169+
fail "Index page not returned on not found resource"
171170
fi
172171
}
173172

174173
check_http_port(){
175-
RANDOM_RESOURCE="$(cat /dev/urandom | tr -dc 'a-z' | fold -w 8 | head -n 1)"
176174
HTTP_STATUS="$(kubectl exec -i -n "$CLUSTER_NAMESPACE" "$CYPRESS_POD" -- curl -s "http://stackgres-restapi.$OPERATOR_NAMESPACE/admin" -X GET -LI -o /dev/null -w '%{http_code}' 2>/dev/null)"
177175

178176
if [ "$HTTP_STATUS" = "200" ]
179177
then
180-
echo "SUCCESS. HTTP port is working when exposed"
178+
success "HTTP port is working when exposed"
181179
else
182-
echo "FAIL. HTTP port is not working when exposed"
183-
return 1
180+
fail "HTTP port is not working when exposed"
184181
fi
185182
}

0 commit comments

Comments
 (0)