Skip to content

test(refactor): Add Toxiproxy Hspec test infrastructure#4836

Open
mkleczek wants to merge 2 commits intoPostgREST:mainfrom
mkleczek:hspec-toxiproxy
Open

test(refactor): Add Toxiproxy Hspec test infrastructure#4836
mkleczek wants to merge 2 commits intoPostgREST:mainfrom
mkleczek:hspec-toxiproxy

Conversation

@mkleczek
Copy link
Copy Markdown
Collaborator

A followup to #4833 which added nix support for toxiproxy, adding support functions to hspec observability module.

@mkleczek mkleczek marked this pull request as draft April 21, 2026 10:13
@mkleczek mkleczek force-pushed the hspec-toxiproxy branch 5 times, most recently from 712c0e8 to e0ffc60 Compare April 21, 2026 13:19
@mkleczek mkleczek marked this pull request as ready for review April 21, 2026 13:35
@mkleczek
Copy link
Copy Markdown
Collaborator Author

postgrest-coverage reports unused code in Toxiproxy module. This is a single file library I've copied from https://github.com/jpittis/toxiproxy-haskell, as the original seems to be unmaintained and needed to be adjusted to newer GHC and libraries (left copyright notice in the file to make sure the original author is attributed).

Not sure how to deal with it now - @steve-chavez @wolfgangwalther - any advice?

Copy link
Copy Markdown
Member

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One limitation of using toxiproxy via hspec is, that we can't put toxiproxy between the client and postgrest, but only between postgrest and postgresql, this way, right?

This seems like a pretty big limitation to me - we surely want to test more scenarios eventually?

I feel like we need an approach that works for both cases the same way, so that we can write tests using toxiproxy the same way every time.

@mkleczek mkleczek force-pushed the hspec-toxiproxy branch 4 times, most recently from fa24956 to 9973489 Compare May 1, 2026 05:54
mkleczek added 2 commits May 3, 2026 14:10
This commit introduces toxiproxy in withTools adding the following helpers:
* withToxiproxyServer
* withToxiproxyProxy
* withToxiproxyPgProxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants