-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves #43 Just a quick smoke test to make sure the example code works, and that we don't totally break the synthesis pod lifecycle code (that can't be easily integration tested). Co-authored-by: Jordan Olshevski <[email protected]>
- Loading branch information
Showing
4 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Smoke Tests | ||
on: | ||
push: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 0 0 * * * | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
|
||
- name: Create Kind cluster | ||
uses: helm/kind-action@v1 | ||
|
||
- name: Run tests | ||
timeout-minutes: 5 | ||
run: ./hack/smoke-test.sh |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# Wait for apiserver to be ready | ||
while true; do | ||
kubectl api-resources | ||
if [[ $? -eq 0 ]]; then | ||
break | ||
else | ||
sleep 1 | ||
fi | ||
done | ||
|
||
# Start Eno | ||
kubectl apply -f api/v1/config/crd | ||
go run ./cmd/eno-controller --health-probe-addr=:0 --metrics-addr=:0 & | ||
go run ./cmd/eno-reconciler --health-probe-addr=:0 --metrics-addr=:0 & | ||
|
||
# Apply example | ||
kubectl apply -f ./examples/simple.yaml | ||
|
||
# Wait for the composition to be reconciled | ||
while true; do | ||
json=$(kubectl get composition test-comp -o=json) | ||
echo "${json}" | ||
|
||
# TODO: Check for readiness once supported | ||
echo $json | jq --exit-status '.status.currentState.synthesized' | ||
if [[ $? -eq 0 ]]; then | ||
break | ||
else | ||
sleep 1 | ||
fi | ||
done | ||
|
||
# Delete the example and wait for cleanup | ||
kubectl delete composition test-comp --wait=true --timeout=1m | ||
|
||
# Clean up controller background jobs | ||
kill $(jobs -p) |