Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ability to rewrite test files output #5188

Open
sdht0 opened this issue Apr 3, 2025 · 4 comments
Open

feat: add ability to rewrite test files output #5188

sdht0 opened this issue Apr 3, 2025 · 4 comments

Comments

@sdht0
Copy link
Contributor

sdht0 commented Apr 3, 2025

Currently if the output of a query changes, we've to manually fix the output in test files.

We should add a --rewrite mode in the test runner which switches from checking the output to rewriting the output.

Prior work:

@sdht0
Copy link
Contributor Author

sdht0 commented Apr 3, 2025

cc @ray6080

@sdht0
Copy link
Contributor Author

sdht0 commented Apr 3, 2025

While we're at it, we should also remove explicit counts I think. The test runner should implicitly read all output until a blank line or EOF, instead of the user having to manually specify and update output counts.

@acquamarin
Copy link
Collaborator

While we're at it, we should also remove explicit counts I think. The test runner should implicitly read all output until a blank line or EOF, instead of the user having to manually specify and update output counts.

I don't think we can remove the number of output counts.
What is a query returns 4 lines?
-STATEMENT unwind [null,null,null,null] as t return t
Newline
Newline
Newline
Newline
Newline
-STATEMENT OTHER
How can the test framework know whether the expected result is 4 lines or 5lines?

@sdht0
Copy link
Contributor Author

sdht0 commented Apr 7, 2025

How can the test framework know whether the expected result is 4 lines or 5lines?

Yeah this will need to be handled. Perhaps the count can be optional.

However I think in the general case it adds a bit more friction when iterating on test cases. Although the automatic rewriter will solve this problem too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants