alamb commented on code in PR #18851: URL: https://github.com/apache/datafusion/pull/18851#discussion_r2547017723
########## docs/source/contributor-guide/testing.md: ########## @@ -46,19 +46,40 @@ cargo nextest run ## Unit tests Tests for code in an individual module are defined in the same source file with a `test` module, following Rust convention. -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. + +For example, to run tests in the `datafusion` crate: + +```shell +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. Review Comment: added links ########## docs/source/contributor-guide/testing.md: ########## @@ -46,19 +46,40 @@ cargo nextest run ## Unit tests Tests for code in an individual module are defined in the same source file with a `test` module, following Rust convention. -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. + +For example, to run tests in the `datafusion` crate: + +```shell +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. + +[test_util]: https://github.com/apache/datafusion/tree/main/datafusion/common/src/test_util.rs +[`assert_batches_sorted_eq`]: https://docs.rs/datafusion/latest/datafusion/macro.assert_batches_sorted_eq.html +[`assert_batches_eq`]: https://docs.rs/datafusion/latest/datafusion/macro.assert_batches_eq.html +[`assert_contains`]: https://docs.rs/datafusion/latest/datafusion/common/macro.assert_contains.html +[`assert_not_contains`]: https://docs.rs/datafusion/latest/datafusion/common/macro.assert_not_contains.html ## sqllogictests Tests -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 Review Comment: I pulled these examples out to make it clearer to see -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
