steve-chavez
0be41a4941
test: negative pgrst_db_pool_available in metrics
...
Proves the failure on https://github.com/PostgREST/postgrest/issues/4622 .
This doesn't require additional test infra, only nginx. Taking advantage
of the `stream {}` context which is also compatible with unix socket
besides TCP.
2026-05-20 10:29:12 -05:00
Taimoor Zaeem and Steve Chavez
dade15acc4
nix(test): add test suite for observability tests
...
- Create separate test suite for observability tests
- Create wrapper script `postgrest-test-observability`
- Add to CI and `postgrest-check`
- Move JWT cache tests under observability tests
Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com >
2026-03-20 09:13:47 -05:00
Taimoor Zaeem and Steve Chavez
05074f41c2
test(io): move fixtures to fixtures/ directory
...
Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com >
(cherry picked from commit 35de13eebd )
2025-11-28 13:23:20 -05:00
Taimoor Zaeem and Steve Chavez
c9c617cce1
test(io): rename fixtures.sql to load.sql
...
Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com >
(cherry picked from commit 3baa6b0063 )
2025-11-28 13:23:20 -05:00
Wolfgang Walther and Steve Chavez
25e56f32e4
nix: avoid updating cabal on every run
...
Resolves #4206
2025-07-17 11:47:44 -05:00
Wolfgang Walther
95e36fdad9
nix: avoid rebuilding memory tests when entering nix-shell
...
The memory tests are now run in the same way as the regular tests.
2025-03-30 18:57:39 +00:00
Wolfgang Walther
001835eddc
nix: reduce number of rebuilds for local development slightly
2025-03-30 18:57:39 +00:00
Wolfgang Walther and Wolfgang Walther
3c95d24d45
nix: update package list from hackage before building
...
This prevents errors in CI after updating the hackage index-state.
2024-11-12 21:13:31 +01:00
Wolfgang Walther
cdcab34852
nix: Make postgrest-lint fail on dead nix code
2024-05-04 20:34:59 +02:00
steve-chavez
d9a51f23ce
test: sanity tests for primary and 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
2024-04-30 18:35:40 -05:00
steve-chavez
4b289b1c97
test: requests wait for schema cache load
...
* nix: add postgrest-test-big-schema command
2024-03-15 06:18:26 -05:00
Laurence Isla and Wolfgang Walther
cf7b9bad08
nix: only json output for postgrest-dump-schema
2024-03-07 16:50:14 +01:00
Laurence Isla and Wolfgang Walther
c276e9741e
nix: fix postgrest-dump-schema with optional yaml output
2024-03-07 16:50:14 +01:00
Wolfgang Walther
a1480c758e
ci: Run postgrest-test-doctests without nix-shell
...
Resolves #3183
2024-02-27 10:02:42 +01:00
Wolfgang Walther
c7eb4036a1
nix: Export all tools on each toolbox
...
This allows targeting each tool separately for installs.
2024-02-26 22:06:01 +01:00
Wolfgang Walther and Wolfgang Walther
8a21a9c34e
fix: Dump media handlers and timezones with --dump-schema
...
Those were left out of the schema dump when the features were introduced, probably
because ByteString doesn't have a toJSON instance. Changing the type to Text solves
this easily.
Resolves #3237
2024-02-20 18:44:17 +01:00
Wolfgang Walther and Wolfgang Walther
e110fdbd2c
nix: Refactor checkedShellScript's inRootDir to workingDir
...
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.
2024-02-18 13:10:00 +01:00
Wolfgang Walther
b22bb748f2
nix: Remove left-over commented out code in postgrest-test-doctests
...
This seems to be commented out for a while already, but nobody reported
problems, so far.
2024-02-11 11:38:53 +01:00
Wolfgang Walther and Wolfgang Walther
410fa9508b
nix: Make postgrest-with-postgresql-xxx postgrest-test-io work better
...
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
2024-02-10 20:51:55 +01:00
Wolfgang Walther and Wolfgang Walther
c43696c9a6
nix: Move postgrest-check-static inside derivation of static package
...
This will make the static build fail if we're not producing a static binary.
2024-01-26 23:24:12 +01:00
Wolfgang Walther and Wolfgang Walther
6682baebd2
nix: Update nixpkgs and build with GHC 9.4.8
2024-01-18 18:54:33 +01:00
steve-chavez
531a183b44
nix: postgrest-coverage notice
2023-08-17 13:43:48 -05:00
steve-chavez
781fa592ca
refactor: delete QueryCost, instead use PlanSpec
2022-12-12 13:31:02 -05:00
Robert Vollmert and Wolfgang Walther
b702c5fbe4
pytest_xdist -> pytest-xdist
2022-10-28 10:49:04 +02:00
Steve Chavez and GitHub
0fbb116dd2
add basic ARCHITECTURE.md ( #2503 )
...
* refactor: move ApiRequest a top-level module
* refactor: rename DbStructure to SchemaCache
* refactor: GucHeader inside Response
* refactor: admin app to Workers
2022-10-10 11:24:45 -05:00
Steve Chavez and GitHub
8911afd079
feat: Allow getting the EXPLAIN plan of a request
2022-07-27 19:33:34 -05:00
steve-chavez
df49f482dc
test: no empty tx started for invalid path/method
2022-07-15 22:23:33 -05:00
Robert Vollmert
9252ec2509
ci: verify that static executable is static
2022-07-12 23:25:06 +02:00
Robert Vollmert
e3252a6e9e
nix: test script without glibc locales
...
glibcLocales is not available e.g. on darwin. This change allows
running various dev tools on darwin, and other theoretical
non-glibc systems.
2022-06-07 21:36:38 +02:00
Robert Vollmert
a9035bba2f
nix: use the matching weeder
...
weeder needs to be compiled with the same GHC that we build postgrest
with.
Before this change, we were relying on the fact that we happened
to set ${compiler} to the same ghc8107 as used by nixpkgs for
haskellPackages, now we explicitly take it from the correct
haskell package set.
2022-06-07 21:36:38 +02:00
Robert Vollmert
4c8c3ccfb2
nix: pass through hspec arguments to postgrest-test-spec
...
This allows e.g. running
postgrest-test-spec --match "some failing test"
2022-06-07 21:36:38 +02:00
Wolfgang Walther and Wolfgang Walther
2fe2c9104b
ci: Fix weeder not stopping CI on error
...
Removes dead code that was unnoticed
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-28 17:12:32 +01:00
Wolfgang Walther and Wolfgang Walther
8b63d928ae
test: Reorganize test/ folder into one subdirectory for each test type
2022-01-07 13:10:36 +01:00
Wolfgang Walther and Wolfgang Walther
1e9031573c
test: Move io-tests SQL fixtures to a separate file
2022-01-04 09:36:22 +01:00
Wolfgang Walther and Remo
74f6e5225c
nix: Add weeder to postgrest-coverage
...
Removes a bit of dead code from SpecHelper.hs
2021-12-04 11:39:56 +01:00
Wolfgang Walther and Wolfgang Walther
ab90bd24e0
nix(feat): Add postgrest-with-git and postgrest-with-pgrst tools
2021-11-27 10:57:29 +01:00
monacoremo
43c8bde8ce
refactor: Add doctests
2021-11-13 04:07:46 +01:00
Wolfgang Walther and Remo
0511e99dd4
nix(refactor): Add withPath to checkedShellScript
2021-08-15 12:35:52 +02:00
Wolfgang Walther and Wolfgang Walther
14ddecc81a
nix(fix): Avoid rebuilding during postgrest-coverage
2021-04-24 15:07:13 +02:00
Wolfgang Walther and Wolfgang Walther
3611eab39c
nix(fix): Make postgrest-dump-schema work in nix-shell --pure
2021-04-24 15:07:13 +02:00
Wolfgang Walther and Wolfgang Walther
b566481477
nix(refactor): Move shell scripts to subdirectory nix/tools
2021-04-18 13:51:39 +02:00