Move mock-chronik-client to modules. We can and should still publish this as a module. Will leave monorepo users on the relative path to support CI.
Automated npm publishing to follow.
Differential D15640
[mock-chronik-client] Move to modules Authored by bytesofman on Mar 6 2024, 00:54.
Details
Move mock-chronik-client to modules. We can and should still publish this as a module. Will leave monorepo users on the relative path to support CI. Automated npm publishing to follow. Confirm move only diff. CI passes for updated paths.
Diff Detail
Event TimelineComment Actions Build Bitcoin ABC Diffs / Diff Testing (alias-server-tests) failed.
Tail of the build log: npm audit fix --force
Run `npm audit` for details.
> alias-server@1.0.0 test
> mocha --reporter mocha-junit-reporter --reporter-options mochaFile=test_results/alias-server-junit.xml --reporter-options testsuitesTitle=Alias Server Unit Tests --reporter-options rootSuiteTitle=Alias Server
Error: Cannot find module '../../mock-chronik-client'
Require stack:
- /work/apps/alias-server/test/chronik.test.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/work/apps/alias-server/test/chronik.test.js:16:31)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at cjsLoader (node:internal/modules/esm/translators:356:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:305:7)
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
at async formattedImport (/work/apps/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
at async exports.requireOrImport (/work/apps/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
at async exports.loadFilesAsync (/work/apps/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
at async singleRun (/work/apps/alias-server/node_modules/mocha/lib/cli/run-helpers.js:125:3)
at async exports.handler (/work/apps/alias-server/node_modules/mocha/lib/cli/run.js:370:5)
------------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
------------------------|---------|----------|---------|---------|-------------------
All files | 7.77 | 0 | 0 | 7.98 |
alias-server | 100 | 100 | 100 | 100 |
config.js | 100 | 100 | 100 | 100 |
alias-server/constants | 100 | 100 | 100 | 100 |
alias.js | 100 | 100 | 100 | 100 |
alias-server/src | 7.27 | 0 | 0 | 7.47 |
alias.js | 5.88 | 0 | 0 | 6.06 | 23-369
app.js | 16.66 | 0 | 0 | 16.66 | 23-183
chronik.js | 4.47 | 0 | 0 | 4.76 | 12-196
db.js | 6.09 | 0 | 0 | 6.09 | 17-308
utils.js | 5 | 0 | 0 | 5.26 | 12-160
------------------------|---------|----------|---------|---------|-------------------
##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='29']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='373']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='140']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='40']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='29']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='363']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/alias-server-junit.xml': No such file or directory
Build alias-server-tests failed with exit code 1Comment Actions Build Bitcoin ABC Diffs / Diff Testing (cashtab-tests) failed.
Tail of the build log: 4 |
> 5 | import { MockChronikClient } from '../../../../apps/mock-chronik-client';
| ^
6 | import { cashtabSettings } from 'config/cashtabSettings';
7 | import cashtabCache from 'config/cashtabCache';
8 | import { cashtabCacheToJSON } from 'helpers';
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.require (src/components/fixtures/helpers.js:5:1)
at Object.require (src/components/Etokens/__tests__/CreateToken.test.js:10:1)
FAIL src/hooks/__tests__/useWallet.test.js
● Test suite failed to run
Cannot find module '../../../../apps/mock-chronik-client' from 'src/components/fixtures/helpers.js'
Require stack:
src/components/fixtures/helpers.js
src/hooks/__tests__/useWallet.test.js
3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 |
> 5 | import { MockChronikClient } from '../../../../apps/mock-chronik-client';
| ^
6 | import { cashtabSettings } from 'config/cashtabSettings';
7 | import cashtabCache from 'config/cashtabCache';
8 | import { cashtabCacheToJSON } from 'helpers';
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.require (src/components/fixtures/helpers.js:5:1)
at Object.require (src/hooks/__tests__/useWallet.test.js:18:1)
FAIL src/components/fixtures/__tests__/CashtabTestWrapper.test.js
● Test suite failed to run
Cannot find module '../../../../apps/mock-chronik-client' from 'src/components/fixtures/helpers.js'
Require stack:
src/components/fixtures/helpers.js
src/components/fixtures/__tests__/CashtabTestWrapper.test.js
3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 |
> 5 | import { MockChronikClient } from '../../../../apps/mock-chronik-client';
| ^
6 | import { cashtabSettings } from 'config/cashtabSettings';
7 | import cashtabCache from 'config/cashtabCache';
8 | import { cashtabCacheToJSON } from 'helpers';
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
at Object.require (src/components/fixtures/helpers.js:5:1)
at Object.require (src/components/fixtures/__tests__/CashtabTestWrapper.test.js:13:1)
Test Suites: 15 failed, 13 passed, 28 total
Tests: 468 passed, 468 total
Snapshots: 0 total
Time: 12.33 s
Ran all test suites.
Build cashtab-tests failed with exit code 1Comment Actions Build Bitcoin ABC Diffs / Diff Testing (ecash-herald-tests) failed.
Tail of the build log:
87 packages are looking for funding
run `npm fund` for details
8 moderate severity vulnerabilities
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
> ecash-herald@1.0.0 test
> mocha --reporter mocha-junit-reporter --reporter-options mochaFile=test_results/ecash-herald-junit.xml --reporter-options testsuitesTitle=Ecash Herald Unit Tests --reporter-options rootSuiteTitle=Ecash Herald
Error: Cannot find module '../../mock-chronik-client'
Require stack:
- /work/apps/ecash-herald/test/chronik.test.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/work/apps/ecash-herald/test/chronik.test.js:6:31)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at cjsLoader (node:internal/modules/esm/translators:356:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:305:7)
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
at async formattedImport (/work/apps/ecash-herald/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
at async exports.requireOrImport (/work/apps/ecash-herald/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
at async exports.loadFilesAsync (/work/apps/ecash-herald/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
at async singleRun (/work/apps/ecash-herald/node_modules/mocha/lib/cli/run-helpers.js:125:3)
at async exports.handler (/work/apps/ecash-herald/node_modules/mocha/lib/cli/run.js:370:5)
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
----------|---------|----------|---------|---------|-------------------
##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='0']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/ecash-herald-junit.xml': No such file or directory
Build ecash-herald-tests failed with exit code 1Comment Actions Build Bitcoin ABC Diffs / Diff Testing (token-server-tests) failed.
Tail of the build log: /work/modules/mock-chronik-client /work/abc-ci-builds/token-server-tests
added 236 packages, and audited 237 packages in 1s
35 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
/work/apps/token-server /work/modules/mock-chronik-client /work/abc-ci-builds/token-server-tests
added 441 packages, and audited 442 packages in 3s
61 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
> token-server@0.0.0 test
> mocha --reporter mocha-junit-reporter --reporter-options mochaFile=test_results/token-server-junit.xml --reporter-options testsuitesTitle=Token Server Unit Tests --reporter-options rootSuiteTitle=Token Server
TSError: ⨯ Unable to compile TypeScript:
test/chronik/wsHandler.test.ts(8,35): error TS2307: Cannot find module '../../../mock-chronik-client' or its corresponding type declarations.
at createTSError (/work/apps/token-server/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/work/apps/token-server/node_modules/ts-node/src/index.ts:863:19)
at getOutput (/work/apps/token-server/node_modules/ts-node/src/index.ts:1077:36)
at Object.compile (/work/apps/token-server/node_modules/ts-node/src/index.ts:1433:41)
at Module.m._compile (/work/apps/token-server/node_modules/ts-node/src/index.ts:1617:30)
at module.exports (/usr/lib/node_modules/nyc/node_modules/default-require-extensions/js.js:7:9)
at /usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4
at require.extensions.<computed> (/work/apps/token-server/node_modules/ts-node/src/index.ts:1621:12)
at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Function.Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.exports.requireOrImport (/work/apps/token-server/node_modules/mocha/lib/nodejs/esm-utils.js:53:16)
at async Object.exports.loadFilesAsync (/work/apps/token-server/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
at async singleRun (/work/apps/token-server/node_modules/mocha/lib/cli/run-helpers.js:125:3)
at async Object.exports.handler (/work/apps/token-server/node_modules/mocha/lib/cli/run.js:370:5)
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 16.66 | 0 | 0 | 16.66 |
parse.ts | 16.66 | 0 | 0 | 16.66 | 25-31
----------|---------|----------|---------|---------|-------------------
##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='1']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='6']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='2']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='1']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='1']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='6']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/token-server-junit.xml': No such file or directory
Build token-server-tests failed with exit code 1Comment Actions Build Bitcoin ABC Diffs / Diff Testing (app-dev-examples) failed.
Tail of the build log: at validate (/work/apps/examples/node_modules/ecashaddrjs/src/validation.js:43:15)
at Object.decode (/work/apps/examples/node_modules/ecashaddrjs/src/base32.js:100:9)
at Object.decode (/work/apps/examples/node_modules/ecashaddrjs/src/cashaddr.js:85:46)
at getUtxosFromAddress (/work/apps/examples/scripts/getUtxosFromAddress.js:20:53)
at sendXec (/work/apps/examples/scripts/sendXec.js:36:51)
at /work/apps/examples/scripts/sendXec.js:91:54
Error: Cannot find module '../../mock-chronik-client/mocks/mockChronikResponses'
Require stack:
- /work/apps/examples/test/sendXec.test.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/work/apps/examples/test/sendXec.test.js:17:5)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at cjsLoader (node:internal/modules/esm/translators:356:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:305:7)
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
at async formattedImport (/work/apps/examples/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
at async exports.requireOrImport (/work/apps/examples/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
at async exports.loadFilesAsync (/work/apps/examples/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
at async singleRun (/work/apps/examples/node_modules/mocha/lib/cli/run-helpers.js:125:3)
at async exports.handler (/work/apps/examples/node_modules/mocha/lib/cli/run.js:370:5)
-----------------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------------------------|---------|----------|---------|---------|-------------------
All files | 49.26 | 11.11 | 44.44 | 49.5 |
mocks | 3.22 | 0 | 0 | 3.22 |
chronikMock.js | 1.63 | 0 | 0 | 1.63 | 11-160
chronikResponses.js | 100 | 100 | 100 | 100 |
scripts | 69.5 | 25 | 88.88 | 70 |
createWallet.js | 100 | 100 | 100 | 100 |
getDetailsFromTxid.js | 80 | 100 | 100 | 80 | 20,35
getTokenDetails.js | 80 | 100 | 100 | 80 | 20,34
getTxHistoryFromAddress.js | 73.33 | 100 | 100 | 73.33 | 29-36,58
getUtxosFromAddress.js | 75 | 100 | 100 | 75 | 30-32,47
listenForConfirmation.js | 50 | 0 | 50 | 50 | 18-45
sendXec.js | 60 | 37.5 | 100 | 61.11 | 69-146,205,233
-----------------------------|---------|----------|---------|---------|-------------------
##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='100']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='203']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='3']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='27']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='16']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='36']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='100']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='202']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/examples-junit.xml': No such file or directory
Build app-dev-examples failed with exit code 1Comment Actions
unit test suite has relative paths to it as well Comment Actions Build Bitcoin ABC Diffs / Diff Testing (app-dev-examples) failed.
Tail of the build log: at validate (/work/apps/examples/node_modules/ecashaddrjs/src/validation.js:43:15)
at Object.decode (/work/apps/examples/node_modules/ecashaddrjs/src/base32.js:100:9)
at Object.decode (/work/apps/examples/node_modules/ecashaddrjs/src/cashaddr.js:85:46)
at getUtxosFromAddress (/work/apps/examples/scripts/getUtxosFromAddress.js:20:53)
at sendXec (/work/apps/examples/scripts/sendXec.js:36:51)
at /work/apps/examples/scripts/sendXec.js:91:54
Error: Cannot find module '../../mock-chronik-client/index'
Require stack:
- /work/apps/examples/test/sendXec.test.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/work/apps/examples/test/sendXec.test.js:20:31)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at cjsLoader (node:internal/modules/esm/translators:356:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:305:7)
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
at async formattedImport (/work/apps/examples/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
at async exports.requireOrImport (/work/apps/examples/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
at async exports.loadFilesAsync (/work/apps/examples/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
at async singleRun (/work/apps/examples/node_modules/mocha/lib/cli/run-helpers.js:125:3)
at async exports.handler (/work/apps/examples/node_modules/mocha/lib/cli/run.js:370:5)
-----------------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------------------------|---------|----------|---------|---------|-------------------
All files | 49.26 | 11.11 | 44.44 | 49.5 |
mocks | 3.22 | 0 | 0 | 3.22 |
chronikMock.js | 1.63 | 0 | 0 | 1.63 | 11-160
chronikResponses.js | 100 | 100 | 100 | 100 |
scripts | 69.5 | 25 | 88.88 | 70 |
createWallet.js | 100 | 100 | 100 | 100 |
getDetailsFromTxid.js | 80 | 100 | 100 | 80 | 20,35
getTokenDetails.js | 80 | 100 | 100 | 80 | 20,34
getTxHistoryFromAddress.js | 73.33 | 100 | 100 | 73.33 | 29-36,58
getUtxosFromAddress.js | 75 | 100 | 100 | 75 | 30-32,47
listenForConfirmation.js | 50 | 0 | 50 | 50 | 18-45
sendXec.js | 60 | 37.5 | 100 | 61.11 | 69-146,205,233
-----------------------------|---------|----------|---------|---------|-------------------
##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='100']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='203']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='3']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='27']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='16']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='36']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='100']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='202']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/examples-junit.xml': No such file or directory
Build app-dev-examples failed with exit code 1 |