Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI docs testing #367

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 52 additions & 3 deletions modules/tutorials/examples/ldap-auth/20-verify-superset.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail
set -uo pipefail
shopt -s lastpipe

source "./utils.sh"

echo "Waiting for superset StatefulSet ..."
kubectl rollout status --watch statefulset/superset-node-default
# wait for superset resource to appear
for (( i=1; i<=30; i++ ))
do
echo "Waiting for superset StatefulSet to appear ..."
if eval kubectl get statefulset superset-node-default; then
break
fi

sleep 3
done

echo "Waiting for superset StatefulSet to become ready ..."
kubectl rollout status --watch --timeout=5m statefulset/superset-node-default

sleep 5

echo "Stackable services:"

stackablectl svc list

echo "Checking if login is working correctly ..."

username="admin"
Expand All @@ -21,6 +36,40 @@ else
exit 1
fi

echo "11111111111111111111111111111111111111111"
sleep 300

if superset_login "db" "$username" "$password"; then
echo "Login successful with $username:$password"
else
echo "Login not successful. Exiting."
exit 1
fi

echo "2222222222222222222222222222222222222222222"
sleep 300

if superset_login "db" "$username" "$password"; then
echo "Login successful with $username:$password"
else
echo "Login not successful. Exiting."
exit 1
fi

echo "33333333333333333333333333333333"
sleep 300

if superset_login "db" "$username" "$password"; then
echo "Login successful with $username:$password"
else
echo "Login not successful. Exiting."
exit 1
fi

echo "FINISHED FINISHED FINISHED FINISHED"
sleep 30000


username="admin"
password="wrongpassword"

Expand Down
10 changes: 10 additions & 0 deletions modules/tutorials/examples/ldap-auth/40-modify-superset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ echo "Applying updated configuration"
kubectl apply -f superset.yaml
# end::apply-superset-cluster[]

for (( i=1; i<=15; i++ ))
do
echo "Waiting for superset StatefulSet to appear ..."
if eval kubectl get statefulset superset-node-default; then
break
fi

sleep 1
done

echo "Waiting for superset StatefulSet ..."
kubectl rollout status --watch statefulset/superset-node-default

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "$0")"

for script in $(find . -name '[0-9][0-9]*sh' | sort)
do
printf "##########################################\n"
Expand Down
4 changes: 4 additions & 0 deletions modules/tutorials/examples/ldap-auth/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ superset_login() {

json_header='Content-Type: application/json'

echo "Checking if Superset is reachable at $superset_addr"
return_code=$(curl --insecure -v -o /dev/null -w "%{http_code}" "$superset_addr")
echo "$return_code"

local response
response=$(curl -Ls "$superset_endpoint" -H "$json_header" --data "$request_data")

Expand Down