Move sqllogictests to sqllogictests crate to break cyclic dependency#7284
Move sqllogictests to sqllogictests crate to break cyclic dependency#7284yjshen merged 12 commits intoapache:mainfrom
Conversation
| - datafusion/substrait/**/* | ||
|
|
||
| sqllogictest: | ||
| - datafusion/core/tests/sqllogictests/**/* |
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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.
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.
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.
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