Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Nov 20, 2025

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

Added examples and links for running tests and using test utilities in the contributor guide.
@alamb alamb added the documentation Improvements or additions to documentation label Nov 20, 2025
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
Copy link
Contributor Author

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added links

@alamb alamb marked this pull request as ready for review November 20, 2025 17:38
cargo test --profile=ci --test sqllogictests
```

```shell
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

@comphead comphead left a 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>
github-merge-queue bot pushed a commit that referenced this pull request Nov 21, 2025
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.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants