Page MenuHomePhabricator

[electrum] add a check-electrum target
ClosedPublic

Authored by PiRK on Jun 26 2023, 10:23.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC86cf136986e6: [electrum] add a check-electrum target
Summary

And run it with check-all and check-extended.
This adds about 5 seconds to the runtime of these test suites.

Depends on D14135

Test Plan
ninja check-electrum
ninja check-all
ninja check-extended

@bot electrum-tests

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Jun 26 2023, 10:23

Tail of the build log:

-- Performing Test have_C__Wno_strict_prototypes
-- Performing Test have_C__Wno_strict_prototypes - Success
-- Looking for C++ include atomic
-- Looking for C++ include atomic - found
-- Performing Test ENABLE_HWCRC32
-- Performing Test ENABLE_HWCRC32 - Success
-- Performing Test have_C__pedantic
-- Performing Test have_C__pedantic - Success
-- Performing Test have_C__Wshadow
-- Performing Test have_C__Wshadow - Success
-- Performing Test have_C__Wundef
-- Performing Test have_C__Wundef - Success
-- Performing Test have_C__Wno_unused_function
-- Performing Test have_C__Wno_unused_function - Success
-- Performing Test have_C__Wno_overlength_strings
-- Performing Test have_C__Wno_overlength_strings - Success
-- Performing Test have_C__std_c89
-- Performing Test have_C__std_c89 - Success
-- Performing Test have_C__Wno_long_long
-- Performing Test have_C__Wno_long_long - Success
-- Performing Test have_C__Wno_duplicated_branches
-- Performing Test have_C__Wno_duplicated_branches - Success
-- Performing Test USE_ASM_X86_64
-- Performing Test USE_ASM_X86_64 - Success
-- Found Event component event: /usr/lib/x86_64-linux-gnu/libevent.so
-- Found Event: /usr/include (found suitable version "2.1.12-stable", minimum required is "2.0.22") found components: event 
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.64")  
-- Found Event component pthreads: /usr/lib/x86_64-linux-gnu/libevent_pthreads.so
-- Found Event: /usr/include (found suitable version "2.1.12-stable", minimum required is "2.0.22") found components: pthreads 
-- Found MiniUPnPc component miniupnpc: /usr/lib/x86_64-linux-gnu/libminiupnpc.so
-- Found MiniUPnPc: /usr/include/miniupnpc (found suitable version "2.2.1", minimum required is "1.9")  
-- Found NATPMP component natpmp: /usr/lib/x86_64-linux-gnu/libnatpmp.so
-- Found NATPMP: /usr/include   
-- Found BerkeleyDB component CXX: /usr/lib/x86_64-linux-gnu/libdb_cxx-5.3.so
-- Found BerkeleyDB: /usr/include (found suitable version "5.3.28", minimum required is "5.3") found components: CXX 
-- Found SQLite3: /usr/include (found suitable version "3.34.1", minimum required is "3.7.17") 
-- Found ZeroMQ component zmq: /usr/lib/x86_64-linux-gnu/libzmq.so
-- Found ZeroMQ: /usr/include (found suitable version "4.3.4", minimum required is "4.1.5")  
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so;-pthread (found version "3.12.4") 
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1n")  
-- Looking for EVP_MD_CTX_new
-- Looking for EVP_MD_CTX_new - found
-- Found QREncode component qrencode: /usr/lib/x86_64-linux-gnu/libqrencode.so
-- Found QREncode: /usr/include   
-- Configuring native build in /work/abc-ci-builds/electrum-tests/native
-- Configuring done
-- Generating done
-- Build files have been written to: /work/abc-ci-builds/electrum-tests
[1/2] link run_tests.py
[2/2] Run Electrum ABC unit tests...
FAILED: electrum/CMakeFiles/check-electrum 
cd /work/abc-ci-builds/electrum-tests/electrum && /usr/bin/python3.9 ./run_tests.py
Traceback (most recent call last):
  File "/work/abc-ci-builds/electrum-tests/electrum/./run_tests.py", line 14, in <module>
    suite.addTests(test_suite)
  File "/usr/lib/python3.9/unittest/suite.py", line 57, in addTests
    for test in tests:
TypeError: '_FailedTest' object is not iterable
ninja: build stopped: cannot make progress due to previous errors.
Build electrum-tests failed with exit code 1

Tail of the build log:

wallet_encryption.py --descriptors        | ✓ Passed  | 5 s
wallet_groups.py                          | ✓ Passed  | 12 s
wallet_hd.py                              | ✓ Passed  | 5 s
wallet_hd.py --descriptors                | ✓ Passed  | 5 s
wallet_import_rescan.py                   | ✓ Passed  | 6 s
wallet_import_with_label.py               | ✓ Passed  | 1 s
wallet_importdescriptors.py               | ✓ Passed  | 3 s
wallet_importmulti.py                     | ✓ Passed  | 3 s
wallet_importprunedfunds.py               | ✓ Passed  | 1 s
wallet_importprunedfunds.py --descriptors | ✓ Passed  | 1 s
wallet_keypool.py                         | ✓ Passed  | 3 s
wallet_keypool_topup.py                   | ✓ Passed  | 3 s
wallet_keypool_topup.py --descriptors     | ✓ Passed  | 2 s
wallet_labels.py                          | ✓ Passed  | 1 s
wallet_labels.py --descriptors            | ✓ Passed  | 1 s
wallet_listreceivedby.py                  | ✓ Passed  | 5 s
wallet_listsinceblock.py                  | ✓ Passed  | 5 s
wallet_listsinceblock.py --descriptors    | ✓ Passed  | 2 s
wallet_listtransactions.py                | ✓ Passed  | 4 s
wallet_listtransactions.py --descriptors  | ✓ Passed  | 3 s
wallet_multiwallet.py                     | ✓ Passed  | 39 s
wallet_multiwallet.py --usecli            | ✓ Passed  | 9 s
wallet_reorgsrestore.py                   | ✓ Passed  | 3 s
wallet_resendwallettransactions.py        | ✓ Passed  | 38 s
wallet_send.py                            | ✓ Passed  | 5 s
wallet_startup.py                         | ✓ Passed  | 2 s
wallet_timelock.py                        | ✓ Passed  | 1 s
wallet_txn_clone.py                       | ✓ Passed  | 1 s
wallet_txn_clone.py --mineblock           | ✓ Passed  | 2 s
wallet_txn_doublespend.py                 | ✓ Passed  | 1 s
wallet_txn_doublespend.py --mineblock     | ✓ Passed  | 2 s
wallet_watchonly.py                       | ✓ Passed  | 1 s
wallet_watchonly.py --usecli              | ✓ Passed  | 1 s
chronik_avalanche.py                      | ○ Skipped | 0 s
chronik_block.py                          | ○ Skipped | 0 s
chronik_block_info.py                     | ○ Skipped | 0 s
chronik_block_txs.py                      | ○ Skipped | 0 s
chronik_blockchain_info.py                | ○ Skipped | 0 s
chronik_blocks.py                         | ○ Skipped | 0 s
chronik_disallow_prune.py                 | ○ Skipped | 0 s
chronik_raw_tx.py                         | ○ Skipped | 0 s
chronik_resync.py                         | ○ Skipped | 0 s
chronik_script_confirmed_txs.py           | ○ Skipped | 0 s
chronik_script_history.py                 | ○ Skipped | 0 s
chronik_script_unconfirmed_txs.py         | ○ Skipped | 0 s
chronik_script_utxos.py                   | ○ Skipped | 0 s
chronik_serve.py                          | ○ Skipped | 0 s
chronik_spent_by.py                       | ○ Skipped | 0 s
chronik_tx.py                             | ○ Skipped | 0 s
chronik_ws.py                             | ○ Skipped | 0 s
chronik_ws_script.py                      | ○ Skipped | 0 s
interface_usdt_net.py                     | ○ Skipped | 0 s
interface_usdt_utxocache.py               | ○ Skipped | 0 s
interface_usdt_validation.py              | ○ Skipped | 0 s

ALL                                       | ✓ Passed  | 1228 s (accumulated) 
Runtime: 246 s

ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1
PiRK planned changes to this revision.Jun 26 2023, 11:06

I'm not sure exactly why it failed on CI as the unittest.discover error is not very helpful, but I'm pretty sure we need to add a bunch of dependency to the install script.

PiRK edited the summary of this revision. (Show Details)

rebase, update test runner filename, update dependency

PiRK planned changes to this revision.Jun 27 2023, 15:31

I forgot to rename the make_kink cmake module (and to delete the cmake cache before rerunning the test)

include the proper cmake module for make_link

This revision is now accepted and ready to land.Jun 27 2023, 16:02
PiRK planned changes to this revision.Jun 27 2023, 17:49

I think the bot target is not working right

[15:37:59]
[Step 1/1] [2/2] Run Electrum ABC unit tests...
[15:37:59]
[Step 1/1] 
[15:37:59]
[Step 1/1] ----------------------------------------------------------------------
[15:37:59]
[Step 1/1] Ran 0 tests in 0.000s
[15:37:59]
[Step 1/1] 
[15:37:59]
[Step 1/1] OK
[15:37:59]
[Step 1/1] ......................................
[15:37:59]
[Step 1/1] ----------------------------------------------------------------------
[15:37:59]
[Step 1/1] Ran 38 tests in 0.027s
[15:37:59]
[Step 1/1] 
[15:37:59]
[Step 1/1] OK
[15:37:59]
[Step 1/1] Build electrum-tests completed successfully
[15:38:06]
[Step 1/1] Process exited with code 0
[15:38:06]
[Step 1/1] Waiting for 1 service processes to complete

I need to make the script fail when no test is detected. Right now unittest.main() succeeds even if it is running 0 tests. Not sure where the second output of 38 tests comes from. I expect 275 tests.

It is obviously still missing some dependencies. I fixed this in another commit that needs to be squashed.

install enough dependencies for testing on CI

This revision is now accepted and ready to land.Jun 27 2023, 19:30
The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
The build failed due to an unexpected infrastructure outage. The administrators have been notified to investigate. Sorry for the inconvenience.
Fabien requested changes to this revision.Jun 27 2023, 20:25

pip3 install -r ${here}/../../electrum/contrib/requirements/requirements.txt => file not found

This revision now requires changes to proceed.Jun 27 2023, 20:25

It is working as expected. The errors and warning visible in the log are not test failures and not unexpected (so can be addressed in separate diffs)

[Step 1/1] ......................................................................................................127.0.0.1 - - [03/Jul/2023 10:21:39] "GET /invoice HTTP/1.1" 503 -
[Step 1/1] .127.0.0.1 - - [03/Jul/2023 10:21:39] "GET / HTTP/1.1" 200 -
[Step 1/1] .127.0.0.1 - - [03/Jul/2023 10:21:39] "GET /invoice HTTP/1.1" 200 -
[Step 1/1] 127.0.0.1 - - [03/Jul/2023 10:21:39] "POST /pay HTTP/1.1" 200 -
[Step 1/1] .127.0.0.1 - - [03/Jul/2023 10:21:39] "GET / HTTP/1.1" 200 -
[Step 1/1] .s............../work/electrum/electrumabc_plugins/fusion/plugin.py:426: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 41394)>
[Step 1/1]   if is_tor_port(host, port):
[Step 1/1] ResourceWarning: Enable tracemalloc to get the object allocation traceback
[Step 1/1] /work/electrum/electrumabc_plugins/fusion/plugin.py:426: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 52188)>
[Step 1/1]   if is_tor_port(host, port):
[Step 1/1] ResourceWarning: Enable tracemalloc to get the object allocation traceback
[Step 1/1] ....Traceback (most recent call last):
[Step 1/1]   File "/work/electrum/electrumabc_plugins/trezor/trezor.py", line 29, in <module>
[Step 1/1]     import trezorlib
[Step 1/1] ModuleNotFoundError: No module named 'trezorlib'
[Step 1/1] ..............................................................................................s.........sss....................................s.s.
[Step 1/1] ----------------------------------------------------------------------
[Step 1/1] Ran 268 tests in 12.139s
[Step 1/1] OK (skipped=7)
This revision is now accepted and ready to land.Jul 3 2023, 11:41
This revision was automatically updated to reflect the committed changes.