Page MenuHomePhabricator

[CI] Run the chronik client integrations tests on diffs
ClosedPublic

Authored by Fabien on Dec 12 2023, 12:28.

Details

Summary

Run the integration test each time a change is made to chronik or the chronik-client ts library.
Note that on CI we don't have a python executable, so be explicit and use python3.

I noticed some nyc generated files appearing in my worktree so I added a .gitignore entry for them.

Test Plan
./contrib/teamcity/build-configurations.py chronik-client-integration-tests

Diff Detail

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

Event Timeline

Fabien requested review of this revision.Dec 12 2023, 12:28

@bot chronik-client-integration-tests

Tail of the build log:

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

> chronik-client@0.9.0 prepublish
> npm run build


> chronik-client@0.9.0 build
> tsc


added 251 packages, and audited 252 packages in 8s

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

1 moderate severity vulnerability

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> chronik-client@0.9.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
Test runner error, aborting: Error: spawn python ENOENT
----------------------|---------|----------|---------|---------|------------------------------------
File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                  
----------------------|---------|----------|---------|---------|------------------------------------
All files             |    5.84 |     0.76 |    1.43 |    5.81 |                                    
 chronik-client       |     100 |      100 |     100 |     100 |                                    
  index.ts            |     100 |      100 |     100 |     100 |                                    
 chronik-client/proto |    5.44 |     0.84 |    1.81 |    5.42 |                                    
  chronik.ts          |    5.44 |     0.84 |    1.81 |    5.42 | ...3,3978-3985,3990-4027,4031-4036 
 chronik-client/src   |    7.56 |        0 |       0 |    7.48 |                                    
  ChronikClient.ts    |    4.19 |        0 |       0 |    4.24 | 29-159,174-218,296-699             
  failoverProxy.ts    |    4.04 |        0 |       0 |    4.16 | 27-299                             
  hex.ts              |   31.57 |        0 |       0 |   33.33 | 30-34,38-42,46-59,63-65            
----------------------|---------|----------|---------|---------|------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='106']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='1812']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='15']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='1955']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='5']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='349']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='104']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='1789']
##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

On CI we don't have python, only python3 so be explicit in the spawn.

@bot chronik-client-integration-tests

bytesofman added a subscriber: bytesofman.

nice. I had to make the python to python3 change to get these to run locally as well.

contrib/teamcity/build-configurations.yml
727 ↗(On Diff #43566)

is this standard syntax to have the repeated "-" for the all case?

This revision is now accepted and ready to land.Dec 12 2023, 17:48
contrib/teamcity/build-configurations.yml
727 ↗(On Diff #43566)

There is no such thing as "standard" since it's all custom syntax (the parser is build-configurations.py if you're interested), but this is deliberate. ninja (the c++ build tool) will parallelize all the builds by default, so you can specify a list of list of targets, each sublist content being run in parallel in a single build step and each sublist sequentially with the other as separate build step.
Example:

- - all
  - install
- - check
  - check-functional

Will run ninja all install then ninja check check-functional