From 2dcd708dd8dbdbc620c121a38cc857097db42ee1 Mon Sep 17 00:00:00 2001 From: Bill Nickless <59262407+wknickless@users.noreply.github.com> Date: Wed, 22 Dec 2021 04:04:27 -0800 Subject: [PATCH] =?UTF-8?q?At=20test=20time,=20confirm=20web=20service=20i?= =?UTF-8?q?s=20started=20and=20responding=20with=20expe=E2=80=A6=20(#210)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * At test time, confirm web service is started and responding with expected content * Add a test to verify safetyValve works --- .github/workflows/test-safetyvalve.yml | 45 ++++++++++++++++++++++++++ .github/workflows/test.yml | 20 +++++++++--- 2 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/test-safetyvalve.yml diff --git a/.github/workflows/test-safetyvalve.yml b/.github/workflows/test-safetyvalve.yml new file mode 100644 index 00000000..d965f5b4 --- /dev/null +++ b/.github/workflows/test-safetyvalve.yml @@ -0,0 +1,45 @@ +name: Test-SafetyValve + +on: + push: + branches: + - patch/properties-no-ldap-oidc + pull_request: + branches: + - patch/properties-no-ldap-oidc + +jobs: + test-safetyvalve: + name: Test NiFi Helm Chart SafetyValve Properties + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Setup Minikube + uses: manusa/actions-setup-minikube@v2.4.1 + with: + minikube version: 'v1.20.0' + kubernetes version: 'v1.20.2' + #github token: ${{ secrets.GITHUB_TOKEN }} + #- run: minikube addons list + #- name: Interact with the cluster + # run: kubectl get nodes + - name: Checkout code + uses: actions/checkout@v1 + - name: Install dependencies + run: | + helm repo add bitnami https://charts.bitnami.com/bitnami + helm repo add dysnix https://dysnix.github.io/charts/ + helm repo update + helm dep up + - 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 + - name: Check safetyValve content is correct + run: | + NPFP=$(kubectl exec pod/nifi-0 -c server -- ps auxww | \ + awk 'BEGIN { RS = " " } /^-Dnifi.properties.file.path/ { split($0,a,"=",seps); printf("%s",a[2]) }') + kubectl exec pod/nifi-0 -c server -- cat $NPFP + kubectl exec pod/nifi-0 -c server -- cat $NPFP | \ + grep 'nifi.content.claim.max.appendable.size=1 B' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e1b78be3..e8f8fffb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,9 +36,19 @@ jobs: run: helm install nifi . - name: Check deployment status run: kubectl wait --for=condition=Ready pod/nifi-0 --timeout=20m - - name: Check web application is available + - name: Wait for NiFi web server to start run: | - sudo apt install socat - kubectl port-forward service/nifi 8443:8443 & - sleep 2 - curl https://127.0.0.1:8443 + for n in [ 0 1 2 3 4 5 6 7 8 9 ] + do + if kubectl logs pod/nifi-0 -c app-log | grep 'JettyServer NiFi has started' + then + exit 0 + fi + sleep 30 + done + echo NiFi did not start for 300 seconds! + exit 1 + - name: Check that web application responds with expected content + run: | + kubectl exec pod/nifi-0 -c server -- curl -sk https://localhost:8443 | \ + grep 'You may have mistyped'