Merge pull request #140 from sartography/feature/add_quickstart_ci_test
Feature/add quickstart ci test
This commit is contained in:
commit
36c49722ac
|
@ -56,7 +56,7 @@ jobs:
|
|||
path: pr/
|
||||
|
||||
cypress-run:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
@ -88,7 +88,7 @@ jobs:
|
|||
working-directory: ./spiffworkflow-backend
|
||||
run: ./keycloak/bin/wait_for_keycloak 5
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@v4
|
||||
uses: cypress-io/github-action@v5
|
||||
with:
|
||||
working-directory: ./spiffworkflow-frontend
|
||||
browser: chrome
|
||||
|
|
|
@ -115,3 +115,32 @@ jobs:
|
|||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
quickstart-guide-test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [create_frontend_docker_container, create_backend_docker_container, create_demo-proxy]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Apps
|
||||
run: ./bin/run_arena_with_docker_compose
|
||||
- name: wait_for_backend
|
||||
working-directory: ./spiffworkflow-backend
|
||||
run: ./bin/wait_for_server_to_be_up 5 8000
|
||||
- name: wait_for_frontend
|
||||
working-directory: ./spiffworkflow-frontend
|
||||
run: ./bin/wait_for_frontend_to_be_up 5 8001
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@v5
|
||||
with:
|
||||
working-directory: ./spiffworkflow-frontend
|
||||
browser: chrome
|
||||
# just run one test to make sure we didn't completely break it
|
||||
spec: cypress/e2e/process_groups.cy.js
|
||||
env:
|
||||
# pass GitHub token to allow accurately detecting a build vs a re-run build
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CYPRESS_SPIFFWORKFLOW_FRONTEND_AUTH_WITH_KEYCLOAK: "false"
|
||||
CYPRESS_SPIFFWORKFLOW_FRONTEND_USERNAME: "admin"
|
||||
CYPRESS_SPIFFWORKFLOW_FRONTEND_PASSWORD: "admin"
|
||||
SPIFFWORKFLOW_FRONTEND_PORT: 8001
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
function error_handler() {
|
||||
>&2 echo "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}."
|
||||
exit "$2"
|
||||
}
|
||||
trap 'error_handler ${LINENO} $?' ERR
|
||||
set -o errtrace -o errexit -o nounset -o pipefail
|
||||
|
||||
mkdir -p spiffworkflow
|
||||
cd spiffworkflow
|
||||
wget https://raw.githubusercontent.com/sartography/spiff-arena/main/docker-compose.yml
|
||||
docker compose pull
|
||||
docker compose up -d
|
|
@ -7,14 +7,12 @@ function error_handler() {
|
|||
trap 'error_handler ${LINENO} $?' ERR
|
||||
set -o errtrace -o errexit -o nounset -o pipefail
|
||||
|
||||
max_attempts="${1:-}"
|
||||
if [[ -z "$max_attempts" ]]; then
|
||||
max_attempts=100
|
||||
fi
|
||||
max_attempts="${1:-100}"
|
||||
port="${2:-7000}"
|
||||
|
||||
echo "waiting for backend to come up..."
|
||||
attempts=0
|
||||
while [[ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:7000/v1.0/status)" != "200" ]]; do
|
||||
while [[ "$(curl -s -o /dev/null -w '%{http_code}' "http://localhost:${port}/v1.0/status")" != "200" ]]; do
|
||||
if [[ "$attempts" -gt "$max_attempts" ]]; then
|
||||
>&2 echo "ERROR: Server not up after $max_attempts attempts. There is probably a problem"
|
||||
exit 1
|
||||
|
@ -22,3 +20,4 @@ while [[ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:7000/v1.0/st
|
|||
attempts=$(( attempts + 1 ))
|
||||
sleep 1
|
||||
done
|
||||
echo "backend up"
|
||||
|
|
|
@ -7,14 +7,12 @@ function error_handler() {
|
|||
trap 'error_handler ${LINENO} $?' ERR
|
||||
set -o errtrace -o errexit -o nounset -o pipefail
|
||||
|
||||
max_attempts="${1:-}"
|
||||
if [[ -z "$max_attempts" ]]; then
|
||||
max_attempts=100
|
||||
fi
|
||||
max_attempts="${1:-100}"
|
||||
port="${2:-7002}"
|
||||
|
||||
echo "waiting for backend to come up..."
|
||||
echo "waiting for keycloak to come up..."
|
||||
attempts=0
|
||||
while [[ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:7002/realms/master/.well-known/openid-configuration)" != "200" ]]; do
|
||||
while [[ "$(curl -s -o /dev/null -w '%{http_code}' "http://localhost:${port}/realms/master/.well-known/openid-configuration")" != "200" ]]; do
|
||||
if [[ "$attempts" -gt "$max_attempts" ]]; then
|
||||
>&2 echo "ERROR: Server not up after $max_attempts attempts. There is probably a problem"
|
||||
exit 1
|
||||
|
@ -22,3 +20,4 @@ while [[ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:7002/realms/
|
|||
attempts=$(( attempts + 1 ))
|
||||
sleep 1
|
||||
done
|
||||
echo "keycloak up"
|
||||
|
|
|
@ -7,14 +7,12 @@ function error_handler() {
|
|||
trap 'error_handler ${LINENO} $?' ERR
|
||||
set -o errtrace -o errexit -o nounset -o pipefail
|
||||
|
||||
max_attempts="${1:-}"
|
||||
if [[ -z "$max_attempts" ]]; then
|
||||
max_attempts=100
|
||||
fi
|
||||
max_attempts="${1:-100}"
|
||||
port="${2:-7001}"
|
||||
|
||||
echo "waiting for backend to come up..."
|
||||
echo "waiting for frontend to come up..."
|
||||
attempts=0
|
||||
while [[ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:7001)" != "200" ]]; do
|
||||
while [[ "$(curl -s -o /dev/null -w '%{http_code}' "http://localhost:${port}")" != "200" ]]; do
|
||||
if [[ "$attempts" -gt "$max_attempts" ]]; then
|
||||
>&2 echo "ERROR: Server not up after $max_attempts attempts. There is probably a problem"
|
||||
exit 1
|
||||
|
@ -22,3 +20,4 @@ while [[ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:7001)" != "2
|
|||
attempts=$(( attempts + 1 ))
|
||||
sleep 1
|
||||
done
|
||||
echo "frontend up"
|
||||
|
|
Loading…
Reference in New Issue