-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Make it easier to update sqltestlogic test expected output ("test script completion mode") #4570
Comments
I am curious if you have any thoughts @mvanschellebeeck @xudong963 and @xxchan ? I may try to code this up over the weekend if you think it is reasonable |
Yes I think it makes total sense. This feature is already tested risingwavelabs/risingwave#6776. It's currently only supported in |
Thanks @xxchan -- if I get a chance this weekend I'll see if I can make a proposal upstream. |
Her is my solution sketch:
/// Update record using output. If this record is then
///
fn update_output(record: output: RecordOutput) -> Result<Record> {
...
} Then it will be possible to write code like for record in input_records {
let record_output = runner.apply_record(record.clone()).await?;
let new_record = update_record(record, record_output)
write!(output_file, "{}", new_record)
} To write out the new file cc @xxchan and @xudong963 |
First sqllogictest PR proposal: risinglightdb/sqllogictest-rs#127 |
I think I need 2 more PRs in sqllogictest before I can implement this feature in DataFusion risinglightdb/sqllogictest-rs#129 Will keep following things |
Usecase
I am writing a new sqllogictest case (I love this tool) and I want to quickly update the expected outputs
For example, given this type of sqllogictest script, I would like to easily update the script (fill in the values of
XX
andYY
)Prior to #4547 (thanks @xxchan and @xudong963 ) I would copy/paste the output from my console into the test file
After #4547 I need to copy/paste a diff and then remove all instances of
+
For example, I do
cargo test -p datafusion --test sqllogictests -- dates
Which would print out
Which while I can do is quite annoying
Desire
Implementation Ideas
This is called "test script completion mode" in sqlllogictest https://www.sqlite.org/sqllogictest/doc/trunk/about.wiki
I think the sqllogictest runner binary has some version of this that looks super awesome (and relevant to updating results), here:
https://github.com/risinglightdb/sqllogictest-rs/blob/d753e4c77fbf00cdaab69477df2e9c3dba3f5fcc/sqllogictest-bin/src/lib.rs#L505
The text was updated successfully, but these errors were encountered: