Skip to content

Commit

Permalink
performance-test: allow to save the measurements in a .gitignored dir
Browse files Browse the repository at this point in the history
The diffs can then be shown via github gists.
  • Loading branch information
BacLuc committed Jan 26, 2025
1 parent 9d9fb02 commit eee9357
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .ops/performance-test/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/measurements
!/measurements/.gitkeep
/node_modules
.env
17 changes: 17 additions & 0 deletions .ops/performance-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ Run tests
docker compose run --rm performance-test run --quiet script.js | jq --sort-keys > output.json
```

Run tests

```shell
API_ROOT_URL="http://localhost:3000"

env_file=.env

if [ -f "$env_file" ]; then
API_ROOT_URL=$(grep '^API_ROOT_URL=' "$env_file" | cut -d '=' -f 2 | tr -d '\r')
fi

datetime=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
filename=$(printf "%s" "$API_ROOT_URL" | sed 's|https?://||; s|/|_|g')_$datetime.json

docker compose run --rm performance-test run --quiet script.js | jq --sort-keys > measurements/$filename
```

Run tests once to debug


Expand Down
Empty file.

0 comments on commit eee9357

Please sign in to comment.