Experimental k6 smoketest
Some checks failed
Fly Deploy / Deploy app (push) Failing after 2m48s
Fly Deploy / Smoketest (push) Has been skipped

This commit is contained in:
Gabriel Simmer 2023-10-23 20:23:17 +01:00
parent a73e8cf1ab
commit 41bdd2b429
Signed by: arch
SSH key fingerprint: SHA256:m3OEcdtrnBpMX+2BDGh/byv3hrCekCLzDYMdvGEKPPQ
3 changed files with 29 additions and 0 deletions

View file

@ -15,3 +15,17 @@ jobs:
- run: flyctl deploy --remote-only
env:
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 }}

View file

@ -3,6 +3,9 @@ name = "gabrielsimmerdotcom"
version = "0.1.0"
edition = "2021"
[profile.release]
strip = true # Automatically strip symbols from the binary.
[dependencies]
axum = { version = "0.6.18", features = ["json"] }
sqlx = { version = "0.7", features = [ "runtime-tokio", "tls-rustls", "sqlite" ] }

12
k6/smoketest.js Normal file
View 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);
};