-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Docs: Enhance testing documentation with examples and links #18851
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
base: main
Are you sure you want to change the base?
Conversation
Added examples and links for running tests and using test utilities in the contributor guide.
| DataFusion's SQL implementation is tested using [sqllogictest](https://github.com/apache/datafusion/tree/main/datafusion/sqllogictest) which are run like other tests using `cargo test --test sqllogictests`. | ||
| DataFusion's SQL implementation is tested using [sqllogictest](https://github.com/apache/datafusion/tree/main/datafusion/sqllogictest). You can run these tests with a command like this: | ||
|
|
||
| ```shell |
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 pulled these examples out to make it clearer to see
| cargo test -p datafusion | ||
| ``` | ||
|
|
||
| The [test_util](https://github.com/apache/datafusion/tree/main/datafusion/common/src/test_util.rs) module provides useful macros to write unit tests effectively, such as [`assert_batches_sorted_eq`] and [`assert_batches_eq`] for RecordBatches and [`assert_contains`] / [`assert_not_contains`] which are used extensively in the codebase. |
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.
added links
| cargo test --profile=ci --test sqllogictests | ||
| ``` | ||
|
|
||
| ```shell |
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.
wouldbe helpful to include how to run a single test file
cargo test --test sqllogictests -- aggregate.slt
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.
Good call -- added in e87fea9
comphead
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.
Thanks @alamb for improving the docs
Co-authored-by: Jeffrey Vo <jeffrey.vo.australia@gmail.com>
Updated the contributor guide to include testing information. ## Which issue does this PR close? - part of #7013 ## Rationale for this change Similarly to #18851, I was trying to find the right documentation to point people (and AI tools) at for running the tests wanted to make it easier to find the testing instructions immediately on the contributing landing page: https://datafusion.apache.org/contributor-guide/index.html#development-environment <img width="672" height="153" alt="Screenshot 2025-11-20 at 12 45 35 PM" src="https://github.com/user-attachments/assets/403d7047-fe37-4c78-b108-f56870a5c9ab" /> ## What changes are included in this PR? Add a link to the testing page directly ## Are these changes tested? I ran it locally ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->
Which issue does this PR close?
Rationale for this change
I was trying to find the right documentation to point people (and AI tools) at for running the tests and found some improvements to the existing testing page that would be nice: https://datafusion.apache.org/contributor-guide/testing.html
What changes are included in this PR?
Added examples and links for running tests and using test utilities in the contributor guide.
Are these changes tested?
I downloaded it locally
Are there any user-facing changes?
Better testing guide