-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Move sqllogictests to sqllogictests crate to break cyclic dependency #7284
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
Conversation
| - datafusion/substrait/**/* | ||
|
|
||
| sqllogictest: | ||
| - datafusion/core/tests/sqllogictests/**/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This illustrates that the sqllogictest code is no longer so deeply nested in the tree, which I think is a good change overall
| rustup default stable | ||
| - name: Run sqllogictest | ||
| run: PG_COMPAT=true PG_URI="postgresql://postgres:postgres@localhost:$POSTGRES_PORT/db_test" cargo test -p datafusion --test sqllogictests | ||
| run: PG_COMPAT=true PG_URI="postgresql://postgres:postgres@localhost:$POSTGRES_PORT/db_test" cargo test --features=postgres --test sqllogictests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now running the posgres compatibility tests requires a feature flag, which I think is a good thing and will speed up normal developer workflows
| export TPCH_DATA=`realpath datafusion/sqllogictest/test_files/tpch/data` | ||
| cargo test serde_q --profile release-nonlto --features=ci -- --test-threads=1 | ||
| INCLUDE_TPCH=true cargo test -p datafusion --test sqllogictests | ||
| INCLUDE_TPCH=true cargo test --test sqllogictests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguable it is easier to run these tests now
| criterion = { version = "0.5", features = ["async_tokio"] } | ||
| csv = "1.1.6" | ||
| ctor = "0.2.0" | ||
| datafusion-sqllogictest = { path = "../sqllogictest", version = "29.0.0", features = ["postgres"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this line to remove the circular dependency is the entire reason for this PR
| tokio = {version = "1.0"} | ||
| bytes = {version = "1.4.0", optional = true} | ||
| futures = {version = "0.3.28", optional = true} | ||
| futures = {version = "0.3.28"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datafusion depends on futures anyways so this is not a new dependency
| } = test_file; | ||
| info!("Running with DataFusion runner: {}", path.display()); | ||
| let Some(test_ctx) = context_for_test_file(&relative_path).await else { | ||
| let Some(test_ctx) = TestContext::try_new_for_test_file(&relative_path).await else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the logic for creating TestContext into the datafusion_sqllogictest library (and out of the runner) to avoid making the runner even longer
| ) | ||
| } | ||
|
|
||
| /// Create a SessionContext, configured for the specific test, if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to test_context.rs
|
|
||
| statement ok | ||
| CREATE EXTERNAL TABLE fixed_size_list_array STORED AS PARQUET LOCATION 'tests/data/fixed_size_list_array.parquet'; | ||
| CREATE EXTERNAL TABLE fixed_size_list_array STORED AS PARQUET LOCATION '../core/tests/data/fixed_size_list_array.parquet'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually it might make sense to move the data files, but for now I just updated the test paths
|
cc @melgenek |
melgenek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only briefly skimmed through the change. Removing the cyclic dependency looks sane to me.
|
Thank you @melgenek |
Which issue does this PR close?
Closes #7281
Rationale for this change
What changes are included in this PR?
datafusion/core/tests/sqlloictesttodatafusion/sqllogictestTestContextand include it in thedatafusion_sqllogictestmoduleMOVED.mdAre these changes tested?
Yes, both manually and via CI
Are there any user-facing changes?
No, but this likely will affect developer tests
New Command
sqllogictest, is now run like this:
The old command was like this
Bonus it also fixes the error called out by @Dandandan in the mailing list thread: https://lists.apache.org/thread/mbm8smv4rombbbsnfgll922768b103z6