Skip to content

Minor: combine dataframe and dataframe_functions tests to save build time and builder disk space - #6682

Closed
alamb wants to merge 2 commits into
apache:mainfrom
alamb:alamb/combine_dataframe_tests
Closed

alamb wants to merge 2 commits into
apache:mainfrom
alamb:alamb/combine_dataframe_tests

Conversation

@alamb

@alamb alamb commented Jun 15, 2023

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Part of #6676

Rationale for this change

We are running into builder space problems so reducing the space needed to run cargo test is required. Also it would be nice to get faster CI runs.

Locally for me on my mac, it seems like each test binary takes a few seconds to compile and 100+MB of disk space. Thus combining them into fewer larger tests (so we have fewer binaries) will be an improvement

What changes are included in this PR?

Combine dataframe and dataframe_function tests:

Are these changes tested?

Yes by existing CI

Are there any user-facing changes?

No -- this is development process

Measurements

dataframe_functions (126MB)

cd /Users/alamb/Software/arrow-datafusion2/ && RUST_BACKTRACE=1 CARGO_TARGET_DIR=/Users/alamb/Software/target-df2 cargo test --test dataframe_functions
    Finished test [unoptimized + debuginfo] target(s) in 0.28s
     Running tests/dataframe_functions.rs (/Users/alamb/Software/target-df2/debug/deps/dataframe_functions-6259330cccb05fd4)
...
(arrow_dev) alamb@MacBook-Pro-8:~/Software/arrow-datafusion2$ du -s -h /Users/alamb/Software/target-df2/debug/deps/dataframe_functions-6259330cccb05fd4
126M	/Users/alamb/Software/target-df2/debug/deps/dataframe_functions-6259330cccb05fd4

dataframe (pre-PR) (133MB)

cd /Users/alamb/Software/arrow-datafusion2/ && RUST_BACKTRACE=1 CARGO_TARGET_DIR=/Users/alamb/Software/target-df2 cargo test --test dataframe
   Compiling datafusion v26.0.0 (/Users/alamb/Software/arrow-datafusion2/datafusion/core)
    Finished test [unoptimized + debuginfo] target(s) in 4.65s
     Running tests/dataframe.rs (/Users/alamb/Software/target-df2/debug/deps/dataframe-bb6b871995f5ee03)

(arrow_dev) alamb@MacBook-Pro-8:~/Software/arrow-datafusion2$ du -s -h /Users/alamb/Software/target-df2/debug/deps/dataframe-bb6b871995f5ee03
133M	/Users/alamb/Software/target-df2/debug/deps/dataframe-bb6b871995f5ee03

dataframe (with this PR) (134MB)

By combining them, the result is 134 MB, A savings of 125MB.

cd /Users/alamb/Software/arrow-datafusion2/ && RUST_BACKTRACE=1 CARGO_TARGET_DIR=/Users/alamb/Software/target-df2 cargo test --test dataframe
   Compiling datafusion v26.0.0 (/Users/alamb/Software/arrow-datafusion2/datafusion/core)
    Finished test [unoptimized + debuginfo] target(s) in 4.98s
     Running tests/dataframe.rs (/Users/alamb/Software/target-df2/debug/deps/dataframe-bb6b871995f5ee03)
...
du -s -h /Users/alamb/Software/target-df2/debug/deps/dataframe-bb6b871995f5ee03
134M	/Users/alamb/Software/target-df2/debug/deps/dataframe-bb6b871995f5ee03

Admittedly these measurements are on my mac, but I think they will hold generally

@github-actions github-actions Bot added the core Core DataFusion crate label Jun 15, 2023
@alamb alamb changed the title Minor: combine dataframe tests Minor: combine dataframe tests to save build time and builder disk space Jun 15, 2023
Ok(())
}

// --------------- Begin dataframe function tests ----------------

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

these tests are moved from one file to another and create_test_table redundancy is removed. Otherwise they are not altered

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suggest you put these into rust modules instead. The issue w/ disk space is NOT that they are in different files but that you have two test binaries.

File struct is:

  • dataframe.rs:
    mod dataframe;
    mod dataframe_functions;
  • dataframe/dataframe.rs
  • dataframe/dataframe_functions.rs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a good idea -- I implemented a modified version of this suggestion in #6697

@alamb alamb changed the title Minor: combine dataframe tests to save build time and builder disk space Minor: combine dataframe and dataframe_functions tests to save build time and builder disk space Jun 15, 2023
@alamb

alamb commented Jun 15, 2023

Copy link
Copy Markdown
Contributor Author

I verified that the moved tests still run. For example:
https://github.com/apache/arrow-datafusion/actions/runs/5282277762/jobs/9557123708?pr=6682

Screenshot 2023-06-15 at 2 51 08 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate development-process Related to development process of DataFusion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants