Welcome! This guide will walk you through the process of solving skipped transformer test cases.
-
Clear your working directory
-
Checkout the main branch:
git checkout main git pull origin main
-
Create a new branch from ****************************
main:⚠️ Do not commit directly tomain.git checkout -b fix/<your-branch-name>
-
Install dependencies and build the project:
pnpm pnpm build
-
Navigate to the transform package and run tests:
cd packages/transform pnpm test
Skipped tests (i.e. known transformer issues) are tracked in:
packages/transform/test-utils/skip-tests/transformer-errors.ts
Each entry looks like this:
[16, 17, "pretty/misc-5.sql", "16-17 transformer fails WITH clause TypeCast prefix issue: transformer adds pg_catalog prefix to JSON types when expected output has none"]16, 17refers to Postgres versions (previous->next) where this issue occurs.pretty/misc-5.sqlis the test case.- The last string is a human-readable explanation of the problem.
You can run an individual test like this:
pnpm test __tests__/kitchen-sink/16-17/pretty-misc.test.ts- Reproduce the failure with the specific test file above.
- Once fixed, comment out the corresponding line in
transformer-errors.ts. - Re-run the test to confirm it now passes:
pnpm test __tests__/kitchen-sink/16-17/pretty-misc.test.tsThen, commit your fix and open a pull request.
Test files like:
__tests__/kitchen-sink/16-17/pretty/misc-6.sql
Follow a specific naming pattern:
pretty/is the folder of test fixture dir (e.g. pretty-printing).misc-6.sqlmeans it's the 6th SQL statement from the originalmisc.sqltest file.- __fixtures__/kitchen-sink/ is where the original sql lives, if you need to see it, in this case __fixtures__/kitchen-sink/pretty is the folder, and __fixtures__/kitchen-sink/pretty/misc.sql is the file
We split multi-statement fixture files into line-by-line test cases to:
- Improve test isolation and debugging clarity
- Enable precise diffs
- Optimize performance by bundling all SQL files into a single JSON blob during test runs
Ready to contribute? Pick an issue from transformer-errors.ts, debug, and push a clean fix on your branch!
Let’s squash these transformer bugs one at a time 💥