Determine which unit tests are impacted by the changes and run them.
The arc unit command starts by running a build, then it uses the
dependency tracking tool from Ninja to determine which test is impacted
by the changes.
Depends on D2792
Differential D2541
[WIP] Integrate test_bitcoin with arcanist through arc unit Fabien on Feb 13 2019, 11:10. Authored by
Details
Determine which unit tests are impacted by the changes and run them. The arc unit command starts by running a build, then it uses the Depends on D2792 Initial state: the previous commit does not modify a c, h or cpp file. arc unit Should return: SKIP No unit test to run arc unit --trace --everything Should return: PASS <duration> Bitcoin unit tests Check in the trace output that all the unit tests are run. Add a comment in the file `src/test/addrman_tests.cpp' arc unit --trace Should return: PASS <duration> Bitcoin unit tests Check in the trace output that the addrman_tests test is run. Add a comment in the file `src/addrman.cpp' arc unit --trace Should return: PASS <duration> Bitcoin unit tests Check in the trace output that the following tests are run: addrman_tests,avalanche_tests,DoS_tests,main_tests,net_tests Reset the changes in `src/addrman.cpp'. Add a comment in the file `src/addrman.h' arc unit --trace Should return: PASS <duration> Bitcoin unit tests Check in the trace output that the same tests are run than in the Add a comment in the file `src/wallet/wallet.h' arc unit --trace Should return: PASS <duration> Bitcoin unit tests Check in the trace output that the following tests are run: wallet_test_fixture,accounting_tests,wallet_tests,walletdb_tests Reset the changes in `src/wallet/wallet.h'. In the file src/test/addrman_tests.cpp, modify the line (currently BOOST_CHECK_EQUAL(addrman.size(), 0); To: BOOST_CHECK_EQUAL(addrman.size(), 1); Then run: arc unit Should return: FAIL addrman_tests.cpp addrman_tests/addrman_simple(87): addrman.size() == 1 Still in the file src/test/addrman_tests.cpp, modify the line BOOST_CHECK_EQUAL(addrman.size(), 1); To: BOOST_CHECK_EQUAL(addrman.size(), 2); In the file src/test/allocator_tests.cpp, modify the line (currently BOOST_CHECK(chunk != nullptr); To: BOOST_CHECK(chunk == nullptr); Then run: arc unit Should return: FAIL addrman_tests.cpp addrman_tests/addrman_simple(87): addrman.size() == 1 addrman_tests/addrman_simple(94): addrman.size() == 2 FAIL allocator_tests.cpp allocator_tests/arena_tests(24): chunk == nullptr Reset the changes in src/test/addrman_tests.cpp and
Diff Detail
Event TimelineComment Actions
Comment Actions I made numerous comments on the implementation as it's probably useful feedback, the code itself being fragile and quite hacky, but I do not think this is fixable as the approach makes no sense to begin with. This just run a random test binary in a way that cannot be relied upon in any workflow using heuristics that hardly catch anything.
Comment Actions Complete rework.
|