Skip to content

test(io): move CORS related tests to test_cors.py#4940

Closed
taimoorzaeem wants to merge 1 commit into
PostgREST:mainfrom
taimoorzaeem:test/io/test-cors
Closed

test(io): move CORS related tests to test_cors.py#4940
taimoorzaeem wants to merge 1 commit into
PostgREST:mainfrom
taimoorzaeem:test/io/test-cors

Conversation

@taimoorzaeem
Copy link
Copy Markdown
Member

@taimoorzaeem taimoorzaeem commented May 19, 2026

Moving them to its own module makes sense. The goal is to group related tests and un-bloat test_io.py.

Moving them to its own module makes sense. The goal is to group related
tests.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
@taimoorzaeem taimoorzaeem added the hygiene cleanup or refactoring label May 19, 2026
@mkleczek
Copy link
Copy Markdown
Collaborator

Moving them to its own module makes sense. The goal is to group related tests and un-bloat test_io.py.

I think it should wait for #4868 to come up with a strategy and the target test module structure.

I agree test_io got too big. But I would be against introducing more and more test suites that need to be executed independently. I would love to have a single command that would be handy for me to run before pushing. Having more commands makes the process more error-prone.

@wolfgangwalther
Copy link
Copy Markdown
Member

wolfgangwalther commented May 19, 2026

I think it should wait for #4868 to come up with a strategy and the target test module structure.

I agree with that... (Edit: Although, I'm not really opposed to the change here, either - it seems pretty straight-forward, and can't really harm, imho)

But I would be against introducing more and more test suites that need to be executed independently.

... but just to be clear here: This does not introduce a new test-suite. It's still part of postgrest-test-io, still the same pytest session. Not all pytests have to be in the same file. It's similar to how spec tests are spread across multiple files.

@wolfgangwalther
Copy link
Copy Markdown
Member

I would love to have a single command that would be handy for me to run before pushing.

Do you know about postgrest-check? This runs all test-suites.

@taimoorzaeem
Copy link
Copy Markdown
Member Author

Yeah, this just puts them to separate module, it always run with postgrest-test-io. This is very similar to how we have Cors.hs in spec test, so to me, it makes sense to also have them in separate module.

I have more ideas with test_io.py, I am thinking of moving all tests related to schema cache and config reloading to test_reloading.py or similar.

@wolfgangwalther
Copy link
Copy Markdown
Member

I have more ideas with test_io.py,

Maybe you can give us a quick outline of how you envision to split it up, eventually? This would allow us to judge the current change in light of that. Maybe a different grouping makes more sense, where more/less (probably not the latter in this case) are in one group.

@taimoorzaeem taimoorzaeem marked this pull request as draft May 19, 2026 10:03
@taimoorzaeem taimoorzaeem removed the hygiene cleanup or refactoring label May 20, 2026
@taimoorzaeem
Copy link
Copy Markdown
Member Author

Closing this and opened #4946.

@taimoorzaeem taimoorzaeem deleted the test/io/test-cors branch May 20, 2026 07:47
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