Enable CI tests #34
Workflow file for this run
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: "Continuous Integration" | |
on: | |
push: | |
# run on pushes to main | |
branches: | |
- main | |
pull_request: | |
# run on pull requests targeting main | |
branches: | |
- main | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup upterm session | |
uses: lhotari/action-upterm@v1 | |
- name: Create kind cluster | |
uses: helm/kind-action@v1.8.0 | |
- name: Deploy From Source | |
uses: hiberbee/github-action-skaffold@1.27.0 | |
with: | |
command: run | |
- name: Wait | |
if: always() | |
run: sleep 11000 | |
- name: Wait For Pods | |
timeout-minutes: 20 | |
run: | | |
set -x | |
kubectl wait --for=condition=available --timeout=10m deployment/adservice | |
kubectl wait --for=condition=available --timeout=10m deployment/cartservice | |
kubectl wait --for=condition=available --timeout=10m deployment/checkoutservice | |
kubectl wait --for=condition=available --timeout=10m deployment/currencyservice | |
kubectl wait --for=condition=available --timeout=10m deployment/emailservice | |
kubectl wait --for=condition=available --timeout=10m deployment/frontend | |
kubectl wait --for=condition=available --timeout=10m deployment/loadgenerator | |
kubectl wait --for=condition=available --timeout=10m deployment/paymentservice | |
kubectl wait --for=condition=available --timeout=10m deployment/productcatalogservice | |
kubectl wait --for=condition=available --timeout=10m deployment/recommendationservice | |
kubectl wait --for=condition=available --timeout=10m deployment/shippingservice | |
- name: Smoke Test | |
timeout-minutes: 5 | |
run: | | |
set -x | |
# start fresh loadgenerator pod | |
kubectl delete pod -l app=loadgenerator | |
# wait for requests to come in | |
REQUEST_COUNT="0" | |
while [[ "$REQUEST_COUNT" -lt "50" ]]; do | |
sleep 5 | |
REQUEST_COUNT=$(kubectl logs -l app=loadgenerator | grep Aggregated | awk '{print $2}') | |
done | |
# ensure there are no errors hitting endpoints | |
ERROR_COUNT=$(kubectl logs -l app=loadgenerator | grep Aggregated | awk '{print $3}' | sed "s/[(][^)]*[)]//g") | |
if [[ "$ERROR_COUNT" -gt "0" ]]; then | |
exit 1 | |
fi |