Skip to content

Commit

Permalink
ci(smoketests): Add new smoke tests for make deploy and `helm insta…
Browse files Browse the repository at this point in the history
…ll` scenarios

Signed-off-by: Caleb Schoepp <caleb.schoepp@fermyon.com>
  • Loading branch information
calebschoepp committed Feb 2, 2024
1 parent 0b092c8 commit 97a3fc4
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
lint-markdown:
name: Lint all markdown files
name: lint all markdown files
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand Down
77 changes: 72 additions & 5 deletions .github/workflows/smoketest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches: [main]

jobs:
test:
make_run:
name: make run
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -29,13 +30,14 @@ jobs:
--port "8081:80@loadbalancer" \
--agents 2
- name: apply runtime class
run: kubectl apply -f spin-runtime-class.yaml
- name: install CRDs and runtime class
run: |
make install
kubectl apply -f spin-runtime-class.yaml
- name: start controller
timeout-minutes: 5
run: |
make install
make run &
timeout 300s bash -c 'until curl -s http://localhost:8082/healthz; do echo "waiting for controller to start"; sleep 2; done'
Expand All @@ -44,7 +46,72 @@ jobs:
- name: run spin app
run: |
kubectl apply -f config/samples/shim-executor.yaml
kubectl apply -f config/samples/simple.yaml
kubectl rollout status deployment simple-spinapp --timeout 90s
kubectl port-forward svc/simple-spinapp 8083:80 &
timeout 15s bash -c 'until curl -f -vvv http://localhost:8083/hello; do sleep 2; done'
- name: Verify curl
run: curl localhost:8083/hello

make_deploy:
name: make deploy
runs-on: ubuntu-latest
env:
IMG: ghcr.io/fermyon/spin-operator/smoketest:latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.21.x"

- name: setup k3d
uses: engineerd/configurator@v0.0.10
with:
name: k3d
url: https://github.com/k3d-io/k3d/releases/download/v5.6.0/k3d-linux-amd64

- name: login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: start k3d cluster
run: |
k3d cluster create wasm-cluster \
--image ghcr.io/deislabs/containerd-wasm-shims/examples/k3d:v0.10.0 \
--port "8081:80@loadbalancer" \
--agents 2
- name: install CRDs and runtime class
run: |
make install
kubectl apply -f spin-runtime-class.yaml
- name: install cert-manager
run: |
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.3/cert-manager.yaml
- name: deploy controller
timeout-minutes: 5
run: |
sleep 20
make docker-build docker-push IMG=${{ env.IMG }}
make deploy IMG=${{ env.IMG }}
sleep 20
echo ""
echo "controller started successfully"
- name: run spin app
run: |
sleep 120
kubectl apply -f config/samples/simple.yaml
kubectl rollout status deployment simple-spinapp --timeout 90s
Expand Down

0 comments on commit 97a3fc4

Please sign in to comment.