When using `postgrest-with-postgresql-* --replica`, the PGRST_DB_URI
will set the replica host as preference. This to be able to run
quick manual tests with postgrest running on a replica.
* new --replica option to `postgrest-with-postgresql-*`
* new command `postgrest-test-replica`
* new sanity tests on test_replica.py
* add postgrest-test-replica to postgrest-check and postgrest-coverage
This allows more flexible control over the working directory. Values for workingDir must always start
with a / and will then be relative to the repo root.
The upside is that postgrest-with-postgresql-xxx postgrest-test-io works as expected
now. The downside is, that postgrest-with-postgresql-xxx psql now starts without
any schema. This now needs an explicit postgrest-with-postgresql-xxx -f path/to.sql
to do anything useful.
Resolves#2864
stock curl doesn't make it easy to make many parallel requests to a
single endpoint. The endpoint has to be repeated N times.
```
curl --parallel https://example.comhttps://example.com ..
```
This provides a wrapper for parallel curl. It's useful for testing
scenarios like pool timeouts.
```
parallel-curl N https://example.com
```
By default, postgrest-with-pgrst builds postgrest as a nix package,
which means that source changes cause a full rebuild. With this
change, running the loadtest as
PGRST_BUILD_CABAL=1 postgrest-loadtest
rebuilds directly using cabal, like postgrest-build. Note that
results between nix and cabal builds aren't necessarily comparable
due to differing build parameters.
* Write vegeta output to file explicitly.
The previous version using `tee` captured the standard
output of the `withPgrst` helper, too, causing weird
errors when those had unexpected output.
* Log and fail the postgrest build explicitly.
In situations such as changing nix dependencies, the
`cabal build` run could fail, but this wasn't visible
in CI.
With these changes, the load test now fails with a nice
error message when the build fails.
Temporary directories are now created in $TMPDIR/postgrest/script-name-XXX. This allows recognizing the origin of a single temporary directory and uploading the whole $TMPDIR/postgrest folder as an artifact in CI.