Page MenuHomePhabricator

[CI] Improve cashtab reporting in case of a test failure
ClosedPublic

Authored by Fabien on Thu, Jan 7, 22:00.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABC9b3702de8db9: [CI] Improve cashtab reporting in case of a test failure
Summary

This diff adds a default (text) reporter to make the tests log available
in the build log, and traps the junit report move to the build directory
so that it gets available even if an error stops the build.

Test Plan

Cause a test to fail, then:

./contrib/teamcity/build-configurations.py cashtab-tests

Check the failure is logged to the console and to the junit report.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien requested review of this revision.Thu, Jan 7, 22:00

Failed tests logs:

====== CashTab Unit Tests: useBCH hook gets SLP and BCH balances and utxos ======
Error: expect(received).toStrictEqual(expected) // deep equality

- Expected  - 4
+ Received  + 4

@@ -21,11 +21,11 @@
        "satoshis": 546,
        "tokenDocumentHash": "",
        "tokenDocumentUrl": "mint.bitcoin.com",
        "tokenId": "009ff65ef50632111a9661f67d80025481ebc80ced239d32a92705b04d5df8cc",
        "tokenName": "TT",
-       "tokenQty": 7,
+       "tokenQty": "7",
        "tokenTicker": "TTT",
        "tokenType": 1,
        "transactionType": "send",
        "tx_hash": "bb055d815e795d7a4fe41fd67288d71886678e7d1e5ba9ddd7f6daffa5f70ceb",
        "tx_pos": 2,
@@ -42,11 +42,11 @@
        "satoshis": 546,
        "tokenDocumentHash": "",
        "tokenDocumentUrl": "mint.bitcoin.com",
        "tokenId": "2aef6e63edfded1a299e78b529286deea2a6dd5299b6911778c25632d78a9479",
        "tokenName": "pitico",
-       "tokenQty": 99.35,
+       "tokenQty": "99.35",
        "tokenTicker": "PTC",
        "tokenType": 1,
        "transactionType": "send",
        "tx_hash": "88b7dac07cb30566a6264f330bedda690c8dff151c2307692c79e13dc59ca2ba",
        "tx_pos": 2,
@@ -68,11 +68,11 @@
          "satoshis": 546,
          "tokenDocumentHash": "",
          "tokenDocumentUrl": "mint.bitcoin.com",
          "tokenId": "009ff65ef50632111a9661f67d80025481ebc80ced239d32a92705b04d5df8cc",
          "tokenName": "TT",
-         "tokenQty": 7,
+         "tokenQty": "7",
          "tokenTicker": "TTT",
          "tokenType": 1,
          "transactionType": "send",
          "tx_hash": "bb055d815e795d7a4fe41fd67288d71886678e7d1e5ba9ddd7f6daffa5f70ceb",
          "tx_pos": 2,
@@ -94,11 +94,11 @@
          "satoshis": 546,
          "tokenDocumentHash": "",
          "tokenDocumentUrl": "mint.bitcoin.com",
          "tokenId": "2aef6e63edfded1a299e78b529286deea2a6dd5299b6911778c25632d78a9479",
          "tokenName": "pitico",
-         "tokenQty": 99.35,
+         "tokenQty": "99.35",
          "tokenTicker": "PTC",
          "tokenType": 1,
          "transactionType": "send",
          "tx_hash": "88b7dac07cb30566a6264f330bedda690c8dff151c2307692c79e13dc59ca2ba",
          "tx_pos": 2,
    at Object.it (/work/web/cashtab/src/hooks/__tests__/useBCH.test.js:75:24)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Each failure log is accessible here:
CashTab Unit Tests: useBCH hook gets SLP and BCH balances and utxos

The (unrelated) failure above shows how the report will look like after this diff is landed. The current report is pretty much useless, see D8840 for an example.

majcosta added a subscriber: majcosta.

looks good

This revision is now accepted and ready to land.Fri, Jan 8, 09:06