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

Commit

Permalink
Test OIDC without a Kubernetes job (#245)
Browse files Browse the repository at this point in the history
Test OIDC without a k8s job
* No longer need job yaml
* Bump chart version
* Wait for statefulset rollout before watching pods
  • Loading branch information
wknickless authored Jun 13, 2022
1 parent 77b561d commit 8e1902c
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 41 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test-ldap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ jobs:
- name: Install Nifi
run: helm install nifi . -f tests/03-ldap-values.yaml
- name: Check deployment status
run: kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m
run: |
kubectl rollout status --timeout=5m --watch statefulset/nifi
kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m
- name: Wait for NiFi web server to start
run: |
for n in [ 0 1 2 3 4 5 6 7 8 9 ]
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/test-oidc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ jobs:
uses: actions/checkout@v1
- name: Install dependencies
run: |
sudo apt-get install -y jq
curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install -y jq yarn
yarn add puppeteer-core --cwd $HOME
yarn add chai --cwd $HOME
yarn add mocha --cwd $HOME
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add dysnix https://dysnix.github.io/charts/
helm repo update
Expand All @@ -36,7 +41,9 @@ jobs:
- name: Install Nifi
run: helm install nifi . -f tests/04-oidc-values.yaml
- name: Check deployment status
run: kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m
run: |
kubectl rollout status --timeout=5m --watch statefulset/nifi
kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m
- name: Wait for NiFi web server to start
run: |
for n in [ 0 1 2 3 4 5 6 7 8 9 ]
Expand All @@ -51,9 +58,7 @@ jobs:
exit 1
- name: Check that OIDC login works
run: |
kubectl apply -f tests/04-oidc-mocha-job.yaml
while ! kubectl logs -f job/oidc-mocha
do
sleep 5
done
kubectl get job/oidc-mocha -o json | jq -e -r '.status.succeeded == 1'
export K8SNODEIP=$(kubectl get node -o json | jq -r '.items[0].status.addresses[0].address')
export K8SPORT=$(kubectl get svc browserless -o json | jq -r '.spec.ports[0].nodePort')
cd $HOME
node_modules/mocha/bin/mocha $GITHUB_WORKSPACE/tests/04-oidc-login-test.js --timeout 30000
4 changes: 3 additions & 1 deletion .github/workflows/test-persistence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
- name: Install Nifi
run: helm install nifi . -f tests/02-persistence-enabled-values.yaml
- name: Check deployment status
run: kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m
run: |
kubectl rollout status --timeout=5m --watch statefulset/nifi
kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m
- name: Get First .processGroupFlow.uri
id: first-pgfuri
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-safetyvalve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jobs:
- name: Install Nifi
run: helm install nifi . -f tests/01-safetyValve-values.yaml
- name: Check deployment status
run: kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m
run: |
kubectl rollout status --timeout=5m --watch statefulset/nifi
kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m
- name: Wait for NiFi web server to start
run: |
for n in [ 0 1 2 3 4 5 6 7 8 9 ]
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-singleuser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ jobs:
- name: Install Nifi
run: helm install nifi .
- name: Check deployment status
run: kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m
run: |
kubectl rollout status --timeout=5m --watch statefulset/nifi
kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m
- name: Wait for NiFi web server to start
run: |
for n in [ 0 1 2 3 4 5 6 7 8 9 ]
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ jobs:
- name: Install Nifi
run: helm install nifi .
- name: Check deployment status
run: kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m
run: |
kubectl rollout status --timeout=5m --watch statefulset/nifi
kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m
- name: Wait for NiFi web server to start
run: |
for n in [ 0 1 2 3 4 5 6 7 8 9 ]
Expand Down
2 changes: 1 addition & 1 deletion tests/04-oidc-login-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('NiFi Login via OIDC', () => {

before(async () => {
browser = await puppeteer.connect({
browserWSEndpoint: 'ws://browserless.default.svc.cluster.local:3000',
browserWSEndpoint: 'ws://'+process.env.K8SNODEIP+':'+process.env.K8SPORT,
ignoreHTTPSErrors: true
})
page = await browser.newPage()
Expand Down
27 changes: 0 additions & 27 deletions tests/04-oidc-mocha-job.yaml

This file was deleted.

0 comments on commit 8e1902c

Please sign in to comment.