Last active
November 18, 2019 03:19
-
-
Save davidmukiibi/4846a40e897c196e4b6a4ee8bc89b28c to your computer and use it in GitHub Desktop.
This is the circleci config file that implements running k6 performance tests in the cloud mode.
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
default: &defaults | |
parallelism: 1 | |
docker: | |
- image: loadimpact/k6:latest | |
run_any_tests_here: &run_any_tests_here | |
run: | |
name: Run Tests | |
command: | | |
cd tests_folder | |
npm run test | |
deploy_to_staging: &deploy_to_staging | |
run: | |
name: Deploy to the staging environment on Google Kubernetes Engine | |
command: | | |
docker build -t gcr.io/loadimpact/k6-tutorial:$CIRCLE_SHA1 . | |
docker push gcr.io/loadimpact/k6-tutorial:$CIRCLE_SHA1 | |
kubectl set image loadimpact/k6-tutorial:latest staging-api=gcr.io/loadimpact/k6-tutorial:$CIRCLE_SHA1 | |
k6_performance_tests: &k6_performance_tests | |
run: | |
name: Running Load Tests Using K6 | |
command: | | |
k6 cloud tests/cloud-test.js | |
deploy_to_production: &deploy_to_production | |
run: | |
name: Deploy to the production environment on Google Kubernetes Engine | |
command: | | |
docker build -t gcr.io/loadimpact/k6-tutorial:$CIRCLE_SHA1 . | |
docker push gcr.io/loadimpact/k6-tutorial:$CIRCLE_SHA1 | |
kubectl set image loadimpact/k6-tutorial:latest production-api=gcr.io/loadimpact/k6-tutorial:$CIRCLE_SHA1 | |
version: 2 | |
jobs: | |
run_any_tests: | |
<<: *defaults | |
steps: | |
- checkout | |
- *run_any_tests_here | |
deploy_to_staging_environment: | |
<<: *defaults | |
steps: | |
- checkout | |
- *deploy_to_staging | |
run_perfomance_tests: | |
<<: *defaults | |
steps: | |
- checkout | |
- *k6_performance_tests | |
deploy_to_production_environment: | |
<<: *defaults | |
steps: | |
- checkout | |
- *deploy_to_production | |
workflows: | |
version: 2 | |
build-and-test: | |
jobs: | |
- run_any_tests | |
- deploy_to_staging_environment: | |
requires: | |
- run_any_tests | |
- run_perfomance_tests: | |
requires: | |
- deploy_to_staging_environment | |
- deploy_to_production_environment: | |
requires: | |
- run_perfomance_tests | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@davidmukiibi, I don't think you need this command if you have set the environment variable properly.
This was NOT required in the past instructions https://loadimpact.com/integrations/performance-testing-circleci/
Can you check out and confirm it?