Added updated Mojaloop license #373
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration test | |
on: | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' | |
required: false | |
default: false | |
push: | |
branches: | |
- '**' | |
jobs: | |
manifest_check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: cachix/install-nix-action@v13 | |
with: | |
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17.tar.gz | |
- name: Install dependencies in environment | |
run: nix-env -if integration_test/default.nix | |
- name: Validate integration test manifest | |
run: kustomize build integration_test | kubeconform -strict -kubernetes-version 1.17.9 | |
integration_test: | |
timeout-minutes: 45 | |
needs: manifest_check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: cachix/install-nix-action@v13 | |
with: | |
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17.tar.gz | |
- name: Install dependencies | |
run: nix-env -if integration_test/default.nix | |
- name: Start cluster | |
run: |- | |
# - --k3s-server-arg args according to | |
# https://k3d.io/faq/faq/#solved-nodes-fail-to-start-or-get-stuck-in-notready-state-with-log-nf_conntrack_max-permission-denied | |
# - Many of these args conserve resources.. for WSO2.. sigh.. | |
# - We deploy our own for increased portability across k8s distributions | |
k3d cluster create \ | |
--no-lb \ | |
--no-rollback \ | |
--k3s-server-arg "--kube-proxy-arg=conntrack-max-per-core=0" \ | |
--k3s-agent-arg "--kube-proxy-arg=conntrack-max-per-core=0" \ | |
--k3s-server-arg "--disable=traefik" \ | |
--k3s-server-arg "--disable=metrics-server" \ | |
--k3s-server-arg "--disable-cloud-controller" \ | |
--kubeconfig-update-default \ | |
--kubeconfig-switch-context \ | |
--image=rancher/k3s:v1.17.9-k3s1 \ | |
int-test | |
- name: Deploy | |
run: skaffold run -p integration-test | |
- name: Wait for kube api server to process and create all resources | |
# This is because the wait step that follows this one does this: | |
# 1. retrieve list of pods | |
# 2. wait for list of pods | |
# Unfortunately, the list of pods might not be complete at step (1), as all pods may not yet | |
# be created, meaning the list of pods waited on in step (2) is not complete. We therefore | |
# wait some time here to allow that to finish before we retrieve the list of pods to wait on. | |
# 30s should be more than enough. | |
run: sleep 30s | |
- name: Wait for deployment readiness | |
# Skaffold is supposed to do this, but for whatever reason, does not. At the time of writing, | |
# investigating this was not a priority. | |
run: timeout 900 kubectl wait --for=condition=Ready pod --all --timeout=900s | |
- name: Wait for populate to complete | |
# This normally happens about a minute after wso2is comes up, but sometimes takes a bit | |
# longer. We wait for the entire duration of the workflow job- why not..? | |
run: time kubectl wait --timeout=600s --for=condition=complete jobs/wso2is-populate | |
- name: Port-forward the portal frontend ingress | |
run: kubectl port-forward -n ingress-nginx --address 0.0.0.0 svc/ingress-nginx-controller 3000:80 & | |
- name: Port-forward voodoo-doll | |
run: kubectl port-forward --address 0.0.0.0 voodoo-doll 3030 & | |
- name: Install test dependencies | |
working-directory: integration_test/e2e-ui-tests | |
run: |- | |
npm ci | |
- name: Run tests | |
working-directory: integration_test/e2e-ui-tests | |
run: |- | |
INGRESS_PORT="3000" FINANCE_PORTAL_ENDPOINT="http://localhost:3000" npm run test:headless | |
- name: Archive screenshots | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: failure-screenshots | |
path: 'integration_test/e2e-ui-tests/screenshots/' | |
- name: Archive settlement finalization reports | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: finalization-reports | |
path: '**/settlement-finalization-report*.xlsx' | |
- name: Print docker containers to check any issues with the cluster | |
if: ${{ failure() }} | |
run: docker ps | |
- name: Print voodoo doll logs | |
if: ${{ always() }} | |
run: kubectl logs voodoo-doll | |
- name: Print resources | |
if: ${{ always() }} | |
run: kubectl get svc,deploy,sts,pv,pvc,configmap,job,pod -A | |
- name: Describe resources | |
if: ${{ always() }} | |
run: kubectl describe svc,deploy,sts,pv,pvc,configmap,job,pod -A | |
- name: Print secret values | |
if: ${{ always() }} | |
run: |- | |
kubectl get secrets -o json | jq -r '.items[] | { name: .metadata.name, data: .data | map_values(@base64d) }' | |
- name: Setup tmate session | |
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 10 |