Skip to content

chore: add xtask to download regression tests#482

Merged
kodiakhq[bot] merged 8 commits intosbdchd:masterfrom
psteinroe:chore/regression-suite
May 20, 2025
Merged

chore: add xtask to download regression tests#482
kodiakhq[bot] merged 8 commits intosbdchd:masterfrom
psteinroe:chore/regression-suite

Conversation

@psteinroe
Copy link
Copy Markdown
Contributor

@psteinroe psteinroe commented May 17, 2025

EDIT: Removed the tests - this PR is just the xtask now :) can't tag you as a reviewer for some reason, but this is ready @sbdchd

adds the postgress regression test suite to stress-test the parser:

  • a xtask that downloads and preprocesses the sql files from the postgres repo
  • a test in the squawk_parser crate that runs all of them through the parser

In the preprocessing step, we remove everything that we do not want to support (yet), mainly plpgsql commands such as \gset.

Right now, all test fail. I peeked through some of the tests and it's mainly due to :name vars. I think it makes sense to lex them as IDENT tokens? Happy to add support for this.

Overall I think this test suite can help stabilise the parser. My hope is that it becomes stable enough to replace libpg_query in the postgres language server.

Also: not sure where to put the tests since currently they all are part of the crate itself. For this kind of tests, I usually integrate them as integration tests. Let me know what you prefer! :)

also happy to not add them at all, or maybe not do snapshot testing, or maybe download the files and run the tests on-demand to not pollute the codebase! maybe a separate xtask that can be executed on-demand in CI / locally makes sense too - like https://areweturboyet.com

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge automerge with kodiak

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants