Skip to content

test(spec): inline config into test suite#4965

Merged
wolfgangwalther merged 6 commits into
PostgREST:mainfrom
wolfgangwalther:test-spec-config
Jun 2, 2026
Merged

test(spec): inline config into test suite#4965
wolfgangwalther merged 6 commits into
PostgREST:mainfrom
wolfgangwalther:test-spec-config

Conversation

@wolfgangwalther
Copy link
Copy Markdown
Member

Previously, information about each test-suite was repeated in 3 separate places:

  • as a label and as implicit knowledge in the test-suite itself,
  • as a comment in Main.hs, and
  • as a configuration in SpecHelper.hs.

With this change, there will be a single source of truth in the test suite itself. This will allow a single test-suite to easily test multiple different configurations.

PoC with a single test-suite changed. Should be extended to all others before merge, if we agree on this.

Helps with #4946 (comment).

Comment thread test/spec/Feature/Auth/NoAnonSpec.hs
@steve-chavez
Copy link
Copy Markdown
Member

PoC with a single test-suite changed. Should be extended to all others before merge, if we agree on this.

Agree, looks good.

@wolfgangwalther
Copy link
Copy Markdown
Member Author

I inlined all the configurations into the spec files. Of course, further simplification and restructuring could follow this up, we have some test suites that could easily be merged into a single file again, for example the different OpenAPI cases etc. - but that's beyond the scope of this PR.

@wolfgangwalther wolfgangwalther marked this pull request as ready for review June 1, 2026 20:48
Previously, information about each test-suite was repeated in 3 separate
places:
- as a label and as implicit knowledge in the test-suite itself,
- as a comment in Main.hs, and
- as a configuration in SpecHelper.hs.

With this change, there will be a single source of truth in the test
suite itself. This will allow a single test-suite to easily test
multiple different configurations.
This was brought over in the last commit, because the postgis was
re-using the same config as another test. Now it has a separate config,
so we can reduce it a bit.
Copy link
Copy Markdown
Member

@taimoorzaeem taimoorzaeem left a comment

Choose a reason for hiding this comment

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

Looks really good. 👍

@wolfgangwalther wolfgangwalther merged commit ed4b68c into PostgREST:main Jun 2, 2026
31 checks passed
@wolfgangwalther wolfgangwalther deleted the test-spec-config branch June 2, 2026 06:49
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.

3 participants