Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into SPSH-1158-test-drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
clauyan committed Nov 13, 2024
2 parents f8a8b2b + b825bcb commit 1f975fc
Show file tree
Hide file tree
Showing 26 changed files with 1,265 additions and 74 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,26 @@

Load and performance tests for the schulportal

##
## Running in the cluster

Go to Actions > Trigger Loadtest > Run workflow.

In the dialog enter the following and replace the UPPERCASE words in the right column with the appropriate values (see explanation below).

| Use workflow from | DBP-1012-setup-loadtest-env |
| Branch to take tests and helm/cron setup from | main |
| sets PATTERN env var used as k6 input | PATTERN |
| sets CONFIG env var used as k6 input | CONFIG |
| name of test scenario defined in values.yaml | SCENARIO |
| execute cronjob scenario after install | true |

### Values explained

| PATTERN | a glob that matches a file in `loadtest/usecases`, i.e. `1` or `login` |
| CONFIG | one of spike, stress, breakpoint, debug; see `loadtest/util/config.ts` |
| SCENARIO | target environment; one of dev-scenario, staging-scenario, prod-scenario; see `charts/schulportal-load-tests/values.yaml` |

## Local

### Setup

Expand Down Expand Up @@ -49,3 +68,9 @@ npm run check # to format, lint, typecheck the code
```sh
npm run generate-client # to generate new type-definitions for the api
```

```sh
# k6 requires filetypes on some imports and won't run without them.
# The error does not give you a lot to go on, but this will list all locations where these extensions are missing.
./find-bad-imports.sh
```
1 change: 1 addition & 0 deletions charts/schulportal-load-tests/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ cronjobs:
staging-scenario:
serviceName: staging-scenario
spsh_base: "https://spsh.staging.spsh.dbildungsplattform.de"
kc_base: "https://keycloak.staging.spsh.dbildungsplattform.de"
# prod-scenario:
# serviceName: prod-scenario
# image: ghcr.io/dbildungsplattform/schulportal-load-tests:latest
Expand Down
2 changes: 2 additions & 0 deletions find-bad-imports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/bash
grep -e "from \"" loadtest/**/*.ts | grep -ve ".*ts\";$" | grep -ve "k6"
Loading

0 comments on commit 1f975fc

Please sign in to comment.