-
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
Move sqllogictests to sqllogictests crate to break cyclic dependency #7284
Conversation
@@ -47,4 +47,4 @@ substrait: | |||
- 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
@@ -270,7 +270,7 @@ jobs: | |||
rustup toolchain install stable | |||
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
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
@@ -102,7 +102,6 @@ bigdecimal = "0.4.1" | |||
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
thiserror = "1.0.44" | ||
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
@@ -121,7 +117,7 @@ async fn run_test_file(test_file: TestFile) -> Result<()> { | |||
relative_path, | |||
} = 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
@@ -250,96 +254,6 @@ fn read_dir_recursive<P: AsRef<Path>>(path: P) -> Box<dyn Iterator<Item = PathBu | |||
) | |||
} | |||
|
|||
/// 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
@@ -2289,7 +2289,7 @@ select make_array(1.0, '2', null) | |||
### FixedSizeListArray | |||
|
|||
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 |
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/sqlloictest
todatafusion/sqllogictest
TestContext
and include it in thedatafusion_sqllogictest
moduleMOVED.md
Are 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