Skip to content
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

chore: disable tests by default for some heavy lib/bins without UTs #12950

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

xxchan
Copy link
Member

@xxchan xxchan commented Oct 18, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

💦💦💦

So that we can avoid them being compiled twice when running unit tests.

No tests are ignored after the change (still 1575 tests, but 84 binaries -> 67 binaries)

Note: there aren't significant improvements, because the bottleneck is not improved.

ref: #9878 (comment)

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #12950 (7f899d3) into main (4a8b0cb) will increase coverage by 0.04%.
Report is 1 commits behind head on main.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main   #12950      +/-   ##
==========================================
+ Coverage   68.27%   68.32%   +0.04%     
==========================================
  Files        1501     1498       -3     
  Lines      252750   252654      -96     
==========================================
+ Hits       172576   172622      +46     
+ Misses      80174    80032     -142     
Flag Coverage Δ
rust 68.32% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 13 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@xxchan
Copy link
Member Author

xxchan commented Oct 18, 2023

@xxchan
Copy link
Member Author

xxchan commented Oct 18, 2023

after merging main it's the same (1591 tests)

@xxchan
Copy link
Member Author

xxchan commented Oct 22, 2023

@TennyZhuang @BugenZhao How do you think?

Comment on lines 49 to 50
[lib]
test = false
Copy link
Member

Choose a reason for hiding this comment

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

So if future developers add unit tests for the runtime crate, they will silently not be run? I'm not sure if this could be a potential risk. 😕

Copy link
Contributor

@xiangjinwu xiangjinwu Oct 25, 2023

Choose a reason for hiding this comment

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

When adding new tests, it is a good habit to confirm a test would fail when the implementation is erroneous accordingly. But of course we cannot just rely on good habits. It is always better to be automated.

We actually had similar problems before #10749, or maybe some existing tests always pass (i.e. do not panic) even when the implementation violates what the test intends to cover, because the test itself is buggy.

Just sharing some thoughts. Not supporting or opposing the approach here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I now have a stupid tool 🤡 https://github.com/xxchan/cargo-utests/blob/main/src/main.rs

It's precise but slow (need to compile to know whether there are tests...) so we can't put it in CI. Alternatively, we can grep #[test] and mark test=false more conservatively. In this case, we can't disable binary targets which should be slow to compile.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, if the project's layout is very standard. (no autobins=false, all binaries are simple single-file wrappers), I think we can do better.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated with only a few crates. They are heavy and probably won't have tests. Maybe we can start with this. 🤡 @BugenZhao

@xxchan
Copy link
Member Author

xxchan commented Oct 24, 2023 via email

@xxchan
Copy link
Member Author

xxchan commented Oct 26, 2023 via email

@xxchan xxchan changed the title chore: disable tests by default for lib/bins without UTs chore: disable tests by default for some heavy lib/bins without UTs Oct 26, 2023
@xxchan
Copy link
Member Author

xxchan commented Oct 27, 2023

cargo test --timings on main

cargo-timing.html.zip

@xxchan
Copy link
Member Author

xxchan commented Oct 27, 2023

too many timeouts

image

@xxchan xxchan added this pull request to the merge queue Oct 27, 2023
Merged via the queue into main with commit 00df635 Oct 27, 2023
10 of 11 checks passed
@xxchan xxchan deleted the xxchan/test branch October 27, 2023 04:48
@xxchan
Copy link
Member Author

xxchan commented Nov 14, 2023

It seems this is quite useful. But we are again hitting the limit soon...

image

@xxchan xxchan mentioned this pull request Nov 15, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants