Skip to content

Commit

Permalink
Merge pull request #106 from aldbr/main_FEAT_integrationtests
Browse files Browse the repository at this point in the history
feat: first integration test (login/logout)
  • Loading branch information
aldbr authored Apr 2, 2024
2 parents cf33c4d + dd6ebf6 commit 9022fe7
Show file tree
Hide file tree
Showing 6 changed files with 1,357 additions and 5 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Integration Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

defaults:
run:
shell: bash -el {0}

jobs:
run-demo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clone source
run: |
cd ..
git clone https://github.com/DIRACGrid/diracx-charts.git
- name: Start demo
run: |
cd ..
diracx-charts/run_demo.sh --exit-when-done diracx-web/
- name: Debugging information
run: |
cd ../diracx-charts
export KUBECONFIG=$PWD/.demo/kube.conf
.demo/kubectl get pods
for pod_name in $(.demo/kubectl get pods -o json | jq -r '.items[] | .metadata.name' | grep -vE '(dex|minio|mysql|rabbitmq|opensearch)'); do
echo "${pod_name}"
.demo/kubectl describe pod/"${pod_name}" || true
for container_name in $(.demo/kubectl get pods $pod_name -o jsonpath='{.spec.initContainers[*].name} {.spec.containers[*].name}'); do
echo $pod_name $container_name
.demo/kubectl logs "${pod_name}" -c "${container_name}" || true
done
done
- name: Check for success
run: |
cd ../diracx-charts
if [ ! -f ".demo/.success" ]; then
echo "Demo failed"
cat ".demo/.failed"
exit 1
fi
- name: Set BASE_URL
run: echo "BASE_URL=$(hostname)" >> $GITHUB_ENV

- name: Start Cypress
uses: cypress-io/github-action@v6
with:
browser: chrome
env: BASE_URL=${{ env.BASE_URL }}
12 changes: 12 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
specPattern: "test/e2e/**/*.cy.ts",
supportFile: false,
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
chromeWebSecurity: false,
});
Loading

0 comments on commit 9022fe7

Please sign in to comment.