File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : k6 Load Tests
2+
3+ # Only trigger when the staging workflow succeeded
4+ on :
5+ workflow_run :
6+ workflows : ["Build & Staging"]
7+ types :
8+ - completed
9+
10+ # allow only one run at a time
11+ concurrency : ${{ github.workflow }}
12+
13+ jobs :
14+ k6_load_test :
15+ name : k6 Load Tests
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v2
21+
22+ - name : Run k6 tests
23+ uses : k6io/action@v0.1
24+ with :
25+ filename : k6LoadTests.js
26+ - name : k6 Load Tests failed notifications
27+ uses : rtCamp/action-slack-notify@v2
28+ env :
29+ SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
30+ SLACK_USERNAME : K6LoadTest
31+ SLACK_ICON : https://a.slack-edge.com/80588/img/services/outgoing-webhook_48.png
32+ SLACK_TITLE : K6 Load Tests has failed.
33+ SLACK_MESSAGE : Some of the k6 load tests has failed.
34+ if : failure()
Original file line number Diff line number Diff line change 44 tags :
55 - ' release-*'
66
7+ # allow only one run at a time
8+ concurrency : ${{ github.workflow }}
9+
710env :
811 CONTAINER_REGISTRY : ghcr.io
912 CONTAINER_REGISTRY_USER : ${{ secrets.GHCR_CONTAINER_REGISTRY_USER }}
1922 K8S_REQUEST_RAM : 400Mi
2023 K8S_LIMIT_CPU : 800m
2124 K8S_LIMIT_RAM : 800Mi
22- K8S_REPLICACOUNT : 2
25+ # horizontal pod autoscaler
26+ K8S_HPA_ENABLED : true
27+ K8S_HPA_MAX_REPLICAS : 8
28+ K8S_HPA_MIN_REPLICAS : 2
29+ K8S_HPA_MAX_CPU_AVG : 80 # 80% from request
30+ # K8S_HPA_MAX_RAM_AVG: 80 # 80% from request
2331
2432jobs :
2533 build :
Original file line number Diff line number Diff line change 1919 K8S_REQUEST_RAM : 250Mi
2020 K8S_LIMIT_CPU : 100m
2121 K8S_LIMIT_RAM : 350Mi
22+ # horizontal pod autoscaler
23+ K8S_HPA_ENABLED : true
24+ K8S_HPA_MAX_REPLICAS : 2
25+ K8S_HPA_MIN_REPLICAS : 1
26+ K8S_HPA_MAX_CPU_AVG : 80 # 80% from request
27+ # K8S_HPA_MAX_RAM_AVG: 80 # 80% from request
2228
2329jobs :
2430 build :
3339 runs-on : ubuntu-latest
3440 needs : build
3541 name : Review
42+ # allow only one deployment at a time
43+ concurrency : ${{ github.workflow }}-${{ github.head_ref }}
44+
3645 steps :
3746 - uses : actions/checkout@v2
3847 - uses : andersinno/kolga-setup-action@v2
Original file line number Diff line number Diff line change 2020 K8S_REQUEST_RAM : 250Mi
2121 K8S_LIMIT_CPU : 100m
2222 K8S_LIMIT_RAM : 350Mi
23- K8S_REPLICACOUNT : 2
23+ # horizontal pod autoscaler
24+ K8S_HPA_ENABLED : true
25+ K8S_HPA_MAX_REPLICAS : 3
26+ K8S_HPA_MIN_REPLICAS : 1
27+ K8S_HPA_MAX_CPU_AVG : 80 # 80% from request
28+ # K8S_HPA_MAX_RAM_AVG: 80 # 80% from request
2429
2530jobs :
2631 build :
3540 runs-on : ubuntu-latest
3641 needs : build
3742 name : Staging
43+
44+ # allow only one deployment at a time
45+ concurrency : ${{ github.workflow }}-${{ github.ref }}
46+
3847 steps :
3948 - uses : actions/checkout@v2
4049 - uses : andersinno/kolga-setup-action@v2
Original file line number Diff line number Diff line change 1+ /* eslint-disable */
2+ import { sleep } from 'k6' ;
3+ import http from 'k6/http' ;
4+
5+ export const options = {
6+ duration : '10m' ,
7+ vus : 100 ,
8+ // vus: 1,
9+ thresholds : {
10+ //avg is around ?100ms? on https://kukkuu.test.kuva.hel.ninja
11+ http_req_duration : [ 'p(95)<5000' ] ,
12+ } ,
13+ } ;
14+
15+ export default ( ) => {
16+ const url = 'https://kukkuu.test.kuva.hel.ninja/graphql' ;
17+ const data = 'query=query Organisations {organisations {edges {node {id } } } }' ;
18+ const res = http . post ( url , data , {
19+ headers : { 'Content-Type' : 'application/x-www-form-urlencoded' } ,
20+ } ) ;
21+
22+ //10 loads per minute
23+ sleep ( 6 ) ;
24+ } ;
You can’t perform that action at this time.
0 commit comments