Page MenuHomePhabricator

[cc-tests] Standardize format of integration tests
ClosedPublic

Authored by bytesofman on Feb 28 2024, 20:44.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCf2220a8cd3bf: [cc-tests] Standardize format of integration tests
Summary

Standardize format of 'before' loop for all chronik-client integration tests. Use required syntax for accessing this from mocha to set a local timeout in future diffs.

Test Plan

CI

Diff Detail

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

Event Timeline

same formatting in websocket.ts

Tail of the build log:

[550/555] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletview.cpp.o
[551/555] Linking CXX static library src/qt/libbitcoin-qt-base.a
[552/555] Automatic MOC for target bitcoin-qt
[553/555] Building CXX object src/qt/CMakeFiles/bitcoin-qt.dir/bitcoin-qt_autogen/mocs_compilation.cpp.o
[554/555] Building CXX object src/qt/CMakeFiles/bitcoin-qt.dir/main.cpp.o
[555/555] Linking CXX executable src/qt/bitcoin-qt
/work/modules/chronik-client /work/abc-ci-builds/chronik-client-integration-tests

> chronik-client@0.23.0 prepublish
> npm run build


> chronik-client@0.23.0 build
> tsc


added 270 packages, and audited 271 packages in 7s

49 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> chronik-client@0.23.0 integration-tests
> mocha -j1 -r ts-node/register test/integration/*.ts --reporter mocha-junit-reporter --reporter-options mochaFile=test_results/chronik-client-integration-tests-junit.xml --reporter-options testsuitesTitle=Chronik Client Integration Tests --reporter-options rootSuiteTitle=Chronik Client

Starting test_runner for chronik-client_websocket
Test runner for chronik-client_websocket started
Starting test_runner for chronik-client_block_and_blocks
Test runner for chronik-client_block_and_blocks started
Test runner for chronik-client_block_and_blocks completed with code 1
-----------------------|---------|----------|---------|---------|-----------------------------------
File                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                 
-----------------------|---------|----------|---------|---------|-----------------------------------
All files              |    5.25 |     0.63 |     1.5 |    5.22 |                                   
 chronik-client        |     100 |      100 |     100 |     100 |                                   
  index.ts             |     100 |      100 |     100 |     100 |                                   
 chronik-client/proto  |    4.81 |     0.68 |    1.86 |    4.82 |                                   
  chronik.ts           |    5.44 |     0.84 |    1.81 |    5.42 | ...,3978-3985,3990-4027,4031-4036 
  chronikNode.ts       |    4.33 |     0.55 |     1.9 |    4.36 | ...,4882-4921,4929-5033,5037-5042 
 chronik-client/src    |    7.69 |        0 |       0 |    7.48 |                                   
  ChronikClient.ts     |    4.24 |        0 |       0 |    4.29 | 33-163,178-222,290-690            
  ChronikClientNode.ts |    6.77 |        0 |       0 |    6.77 | 33-183,198-236,249-321,391-939    
  failoverProxy.ts     |       5 |        0 |       0 |    5.15 | 32-305                            
  hex.ts               |   31.57 |        0 |       0 |   33.33 | 33-37,41-45,49-62,66-68           
  validation.ts        |      15 |        0 |       0 |   10.52 | 12-47                             
-----------------------|---------|----------|---------|---------|-----------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='214']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='4074']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='28']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='4416']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='11']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='732']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='211']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='4035']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/chronik-client-integration-tests-junit.xml': No such file or directory
Build chronik-client-integration-tests failed with exit code 1
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.

tbh it might be worth just doing it all in one go so we avoid this

modules/chronik-client/test/integration/block_and_blocks.ts
21 ↗(On Diff #45727)

The before async function needs to not be an arrow function, i.e. async function() {} and not async () => {}

bytesofman retitled this revision from [cc-tests] Move testRunner definition out of before loop to [cc-tests] Standardize format of integration tests.Feb 28 2024, 21:02
bytesofman edited the summary of this revision. (Show Details)

Fix comment about var definition

remove unrelated linebreak change

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.
This revision is now accepted and ready to land.Feb 29 2024, 08:36