-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add examples to run k6 tests in CI using github actions
- Loading branch information
1 parent
a193c69
commit f846d1f
Showing
8 changed files
with
259 additions
and
9 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,25 @@ | ||
name: Basic Test Workflow | ||
on: [push] | ||
|
||
jobs: | ||
basic_k6_test: | ||
name: k6 test run - basic example | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
quickpizza: | ||
image: ghcr.io/grafana/quickpizza-local:latest | ||
ports: | ||
- 3333:3333 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup k6 | ||
uses: grafana/setup-k6-action@v1 | ||
- name: Run k6 test | ||
uses: grafana/run-k6-action@v1 | ||
with: | ||
path: | | ||
./k6/foundations/01.basic.js | ||
flags: --duration 5s |
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,26 @@ | ||
name: Browser Test Workflow | ||
on: [push] | ||
|
||
jobs: | ||
basic_k6_test: | ||
name: k6 test run - browser test example | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
quickpizza: | ||
image: ghcr.io/grafana/quickpizza-local:latest | ||
ports: | ||
- 3333:3333 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup k6 | ||
uses: grafana/setup-k6-action@v1 | ||
with: | ||
browser: true | ||
- name: Run k6 test | ||
uses: grafana/run-k6-action@v1 | ||
with: | ||
path: | | ||
./k6/browser/01.basic.js |
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,25 @@ | ||
name: CLI Flags Test Workflow | ||
on: [push] | ||
|
||
jobs: | ||
basic_k6_test: | ||
name: k6 test run - CLI flags example | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
quickpizza: | ||
image: ghcr.io/grafana/quickpizza-local:latest | ||
ports: | ||
- 3333:3333 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup k6 | ||
uses: grafana/setup-k6-action@v1 | ||
- name: Run k6 test | ||
uses: grafana/run-k6-action@v1 | ||
with: | ||
path: | | ||
./k6/foundations/01.basic.js | ||
flags: --vus 10 --duration 5s |
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,26 @@ | ||
name: Environment Variables Test Workflow | ||
on: [push] | ||
|
||
jobs: | ||
basic_k6_test: | ||
name: k6 test run - environment variable example | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
quickpizza: | ||
image: ghcr.io/grafana/quickpizza-local:latest | ||
ports: | ||
- 3355:3333 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup k6 | ||
uses: grafana/setup-k6-action@v1 | ||
- name: Run k6 test | ||
uses: grafana/run-k6-action@v1 | ||
env: | ||
BASE_URL: "http://localhost:3355" | ||
with: | ||
path: | | ||
./k6/foundations/01.basic.js |
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: Multiple Test Scripts Workflow | ||
on: [push] | ||
|
||
jobs: | ||
basic_k6_test: | ||
name: k6 test run - running multiple scripts | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
quickpizza: | ||
image: ghcr.io/grafana/quickpizza-local:latest | ||
ports: | ||
- 3333:3333 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup k6 | ||
uses: grafana/setup-k6-action@v1 | ||
- name: Run k6 test | ||
uses: grafana/run-k6-action@v1 | ||
with: | ||
path: | | ||
./k6/foundations/*basic*.js |
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,27 @@ | ||
name: Specific k6 version Workflow | ||
on: [push] | ||
|
||
jobs: | ||
basic_k6_test: | ||
name: k6 test run - specific k6 version example | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
quickpizza: | ||
image: ghcr.io/grafana/quickpizza-local:latest | ||
ports: | ||
- 3333:3333 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup k6 | ||
uses: grafana/setup-k6-action@v1 | ||
with: | ||
k6-version: '0.49.0' | ||
- name: Run k6 test | ||
uses: grafana/run-k6-action@v1 | ||
with: | ||
cloud-run-locally: false | ||
path: | | ||
./k6/foundations/01.basic.js |
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,25 @@ | ||
name: Verify scripts Workflow | ||
on: [push] | ||
|
||
jobs: | ||
basic_k6_test: | ||
name: k6 test run - verify scripts example | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
quickpizza: | ||
image: ghcr.io/grafana/quickpizza-local:latest | ||
ports: | ||
- 3333:3333 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup k6 | ||
uses: grafana/setup-k6-action@v1 | ||
- name: Verify test script | ||
uses: grafana/run-k6-action@v1 | ||
with: | ||
path: | | ||
./k6/foundations/01.basic.js | ||
only-verify-scripts: true |
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