Experimental k6 smoketest
This commit is contained in:
parent
a73e8cf1ab
commit
41bdd2b429
|
@ -15,3 +15,17 @@ jobs:
|
||||||
- run: flyctl deploy --remote-only
|
- run: flyctl deploy --remote-only
|
||||||
env:
|
env:
|
||||||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
||||||
|
smoketest:
|
||||||
|
name: Smoketest
|
||||||
|
needs: deploy
|
||||||
|
runs-on: debian-latest-arm
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3.6.0
|
||||||
|
- name: Run k6 local test
|
||||||
|
uses: https://github.com/grafana/k6-action@v0.3.0
|
||||||
|
with:
|
||||||
|
filename: k6/smoketest.js
|
||||||
|
flags: -o experimental-prometheus-rw --tag testid=smoketest-${GITHUB_SHA}
|
||||||
|
env:
|
||||||
|
K6_PROMETHEUS_RW_SERVER_URL: ${{ secrets.PROMETHEUS_URL }}
|
||||||
|
|
|
@ -3,6 +3,9 @@ name = "gabrielsimmerdotcom"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
strip = true # Automatically strip symbols from the binary.
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
axum = { version = "0.6.18", features = ["json"] }
|
axum = { version = "0.6.18", features = ["json"] }
|
||||||
sqlx = { version = "0.7", features = [ "runtime-tokio", "tls-rustls", "sqlite" ] }
|
sqlx = { version = "0.7", features = [ "runtime-tokio", "tls-rustls", "sqlite" ] }
|
||||||
|
|
12
k6/smoketest.js
Normal file
12
k6/smoketest.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import http from 'k6/http';
|
||||||
|
import { check, sleep} from 'k6';
|
||||||
|
|
||||||
|
export const options = {
|
||||||
|
vus: 3, // Key for Smoke test. Keep it at 2, 3, max 5 VUs
|
||||||
|
duration: '1m', // This can be shorter or just a few iterations
|
||||||
|
};
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const urlRes = http.get('https://gabrielsimmer.com');
|
||||||
|
sleep(1);
|
||||||
|
};
|
Loading…
Reference in a new issue