Skip to content

Commit

Permalink
add e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig O'Donnell committed Oct 18, 2023
1 parent 4223ae1 commit c4cbeaf
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/actions/validate-endpoints/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
description: 'If the chart was deployed via kubectl after running helm template'
required: false
default: 'false'
is-airgap:
description: 'If the chart was deployed in airgap mode'
required: false
default: 'false'
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -110,6 +114,7 @@ runs:
fi
- name: Validate /app/updates endpoint
if: ${{ inputs.is-airgap }} == 'false'
shell: bash
run: |
updatesLength=$(curl -s --fail --show-error localhost:8888/api/v1/app/updates | jq '. | length' | tr -d '\n')
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,52 @@ jobs:
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false -f test-values.yaml | kubectl delete -f -
kubectl wait --for=delete deployment/test-chart --timeout=2m
kubectl wait --for=delete deployment/replicated --timeout=2m
# validate airgap
- name: Install via Helm as subchart in production mode
run: |
helm install test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --set replicated.isAirgap=true --wait --timeout 2m
kubectl wait --for=condition=exists secret/replicated-instance-report --timeout=1m
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
integration-enabled: 'false'
is-airgap: 'true'

- name: Uninstall test-chart via Helm
run: |
helm uninstall test-chart --wait --timeout 2m
kubectl wait --for=delete secret/replicated-instance-report --timeout=1m
- name: Install via kubectl as subchart in production mode
run: |
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --set replicated.isAirgap=true | kubectl apply -f -
kubectl rollout status deployment test-chart --timeout=2m
kubectl rollout status deployment replicated --timeout=2m
kubectl wait --for=condition=exists secret/replicated-instance-report --timeout=1m
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
integration-enabled: 'false'
deployed-via-kubectl: 'true'
is-airgap: 'true'

- name: Uninstall test-chart via kubectl
run: |
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --set replicated.isAirgap=true | kubectl delete -f -
kubectl wait --for=delete deployment/test-chart --timeout=2m
kubectl wait --for=delete deployment/replicated --timeout=2m
kubectl wait --for=delete secret/replicated-instance-report --timeout=1m
- name: Remove Cluster
uses: replicatedhq/replicated-actions/[email protected]
Expand Down

0 comments on commit c4cbeaf

Please sign in to comment.