Skip to content

test: remove BasicTestingSetup from unit tests that don't need it - #22086

Merged
laanwj merged 16 commits into
bitcoin:masterfrom
fanquake:remove_unneeded_test_setup
Jun 2, 2021
Merged

laanwj merged 16 commits into
bitcoin:masterfrom
fanquake:remove_unneeded_test_setup

Conversation

@fanquake

Copy link
Copy Markdown
Member
  • Less setup/overhead for tests that don't need it. Some naive bench-marking would suggest that a full test_bitcoin run is a few % faster after this change.
  • Tests which don't need the BasicTestingSetup can't accidentally end up depending on it somehow.
  • Already the case in at least the scheduler and block_filter tests.

This adds missing includes, but more significant is the removal of setup_common.h from tests where it isn't needed. This saves recompiling those tests when changes are made in the header.

@fanquake fanquake added the Tests label May 27, 2021
@practicalswift

Copy link
Copy Markdown
Contributor

Concept ACK

@fanquake
fanquake force-pushed the remove_unneeded_test_setup branch 2 times, most recently from cbe12cc to c131fc5 Compare May 28, 2021 00:11
@fanquake
fanquake force-pushed the remove_unneeded_test_setup branch from c131fc5 to 6c3fcd5 Compare May 28, 2021 11:14
@practicalswift

Copy link
Copy Markdown
Contributor

cr ACK 6c3fcd5: patch looks correct

@theStack

Copy link
Copy Markdown
Contributor

Concept ACK

@laanwj

laanwj commented Jun 2, 2021

Copy link
Copy Markdown
Member

ACK 6c3fcd5

@laanwj
laanwj merged commit a7d17da into bitcoin:master Jun 2, 2021
@fanquake
fanquake deleted the remove_unneeded_test_setup branch June 3, 2021 02:58
@maflcko

maflcko commented Jun 3, 2021

Copy link
Copy Markdown
Member

Nice.

In the future we could consider removing BOOST_FIXTURE_TEST_SUITE completely and letting the tests pick their specific modules that they need from the node setup.

gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants