From 37966bd6ef81505621fda068a7e84054f29f96f6 Mon Sep 17 00:00:00 2001 From: Benjamin Cane Date: Sat, 4 Nov 2023 08:40:40 -0700 Subject: [PATCH 1/3] Adding load testing CI step --- .github/workflows/load.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/load.yml diff --git a/.github/workflows/load.yml b/.github/workflows/load.yml new file mode 100644 index 0000000..eb684cd --- /dev/null +++ b/.github/workflows/load.yml @@ -0,0 +1,31 @@ +name: load + +on: + push: + tags: + - v* + branches: + - main + pull_request: +jobs: + load-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run the Service + run: make run + - name: Wait for the Service to be ready + run: | + while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost/ready)" != "200" ]]; do sleep 5; done + - name: Configure Test + run: | + cat << EOF > loadtest-config.yml + url: http://localhost:8080 + SLOs: + http/error-rate: 0 + http/latency-p99.9: 5 + EOF + - uses: iter8-tools/iter8-action@v1 + with: + chart: load-test-http + valuesFile: loadtest-config.yml From 516778a4a2233b4a880164b66bfcee86da5786a6 Mon Sep 17 00:00:00 2001 From: Benjamin Cane Date: Sat, 4 Nov 2023 09:15:56 -0700 Subject: [PATCH 2/3] Adding sleep for MySQL --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 013f614..dec1587 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ tests: docker-compose: docker compose up -d mysql + sleep 15 docker compose up airport-lookup-example run: build docker-compose From e28074bb65a8788f4449c9e007ff0f09de3a76a0 Mon Sep 17 00:00:00 2001 From: Benjamin Cane Date: Sat, 4 Nov 2023 09:36:08 -0700 Subject: [PATCH 3/3] Moving things to the background --- .github/workflows/load.yml | 2 +- Makefile | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/load.yml b/.github/workflows/load.yml index eb684cd..05125ee 100644 --- a/.github/workflows/load.yml +++ b/.github/workflows/load.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Run the Service - run: make run + run: make run-background - name: Wait for the Service to be ready run: | while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost/ready)" != "200" ]]; do sleep 5; done diff --git a/Makefile b/Makefile index dec1587..2b092a8 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,14 @@ docker-compose: sleep 15 docker compose up airport-lookup-example +docker-compose-background: + docker compose up -d mysql + sleep 15 + docker compose up -d airport-lookup-example + run: build docker-compose run-nobuild: docker-compose +run-background: build docker-compose-background clean: rm -rf functions/build