Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
CI: Test run all workflow examples (#102)
Browse files Browse the repository at this point in the history
Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
  • Loading branch information
eloycoto committed Mar 14, 2023
1 parent cd88467 commit 28b54d4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,6 @@ jobs:
- name: Run example script
run: |
export SERVERIP=$(kubectl get nodes kind-control-plane -o json | jq -r '[.status.addresses[] | select(.type=="InternalIP")] | .[0].address')
SERVER_IP="${SERVERIP}" SERVERPORT=80 ./workflow-examples/run_examples.sh
SERVER_IP="${SERVERIP}" SERVERPORT=80 ./workflow-examples/run_examples.sh escalation
SERVER_IP="${SERVERIP}" SERVERPORT=80 ./workflow-examples/run_examples.sh simple
SERVER_IP="${SERVERIP}" SERVERPORT=80 ./workflow-examples/run_examples.sh complex
40 changes: 28 additions & 12 deletions workflow-examples/run_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ wait_project_start() {


run_simple_flow() {
echo "Running simple flow"
wait_project_start
echo "Project is ✔️ on ${TARGET_URL}"
echo " "
Expand All @@ -122,6 +123,8 @@ run_simple_flow() {
-H 'accept: */*' \
-H 'Authorization: Basic dGVzdDp0ZXN0' \
-H 'Content-Type: application/json' \
-H "X-XSRF-TOKEN: ${TOKEN}" \
-b $COOKIEFP \
-d '{
"name": "project-1",
"description": "an example project"
Expand All @@ -138,6 +141,8 @@ run_simple_flow() {
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic dGVzdDp0ZXN0' \
-H "X-XSRF-TOKEN: ${TOKEN}" \
-b $COOKIEFP \
-d '{
"projectId": "'$PROJECT_ID'",
"workFlowName": "simpleSequentialWorkFlow_INFRASTRUCTURE_WORKFLOW",
Expand All @@ -164,6 +169,7 @@ run_simple_flow() {

run_complex_flow() {
echo " "
echo "Running Complex Workflow"
wait_project_start
echo "Project is ✔️ on ${TARGET_URL}"
echo " "
Expand Down Expand Up @@ -290,16 +296,26 @@ run_escalation_flow() {
echo " "
}

if [ $# -eq 0 ] || [ $1 = "escalation" ]; then
echo_blue "##### Running escalation flow #####"

if [ $# -eq 0 ]; then
run_escalation_flow
elif [ $1 = "complex" ]; then
echo_blue "##### Running complex flow #####"
run_complex_flow
elif [ $1 = "simple" ]; then
echo_blue "##### Running simple flow #####"
run_simple_flow
else
echo_red "##### Unsupported argument #####"
echo "Options: escalation (default) , complex, simple"
fi
exit 0
fi

case $1 in
"escalation")
run_escalation_flow
;;

"complex")
run_complex_flow
;;

"simple")
run_simple_flow
;;
*)
echo_red "##### Unsupported argument #####"
echo "Options: escalation (default) , complex, simple"
;;
esac

0 comments on commit 28b54d4

Please sign in to comment.