Page MenuHomePhabricator

[alias-server] Organizing files into src folder
ClosedPublic

Authored by bytesofman on Mar 30 2023, 18:39.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC3de86df7cb9d: [alias-server] Organizing files into src folder
Summary

T3060

In building the old stack, recognized it was much better to have node files in an src folder, with a single index.js at the top level along with admin config files. Adopting this structure early on.

Test Plan

Confirm config.js import is adjusted on all files in new src/ folder
wipe database and node index.js, app will run and error out trying to send too many tg msgs

Diff Detail

Repository
rABC Bitcoin ABC
Branch
alias-server-dir-structure
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22854
Build 45328: Build Diffalias-server-tests
Build 45327: arc lint + arc unit

Event Timeline

Tail of the build log:

  run `npm fund` for details

4 moderate severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm notice 
npm notice New major version of npm available! 7.7.6 -> 9.6.2
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.2>
npm notice Run `npm install -g npm@9.6.2` to update!
npm notice 

> 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 '../alias'
Require stack:
- /work/web/alias-server/test/alias.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/work/web/alias-server/test/alias.js:9:5)
    at Module._compile (node:internal/modules/cjs/loader:1092: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:1121: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:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:201:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:154:23)
    at async Loader.import (node:internal/modules/esm/loader:177:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:437:15)
    at async formattedImport (/work/web/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
    at async Object.exports.requireOrImport (/work/web/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
    at async Object.exports.loadFilesAsync (/work/web/alias-server/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
    at async singleRun (/work/web/alias-server/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async Object.exports.handler (/work/web/alias-server/node_modules/mocha/lib/cli/run.js:370:5)
-----------|---------|----------|---------|---------|-------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-----------|---------|----------|---------|---------|-------------------
All files  |     100 |      100 |     100 |     100 |                   
 config.js |     100 |      100 |     100 |     100 |                   
-----------|---------|----------|---------|---------|-------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='1']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='1']
##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='1']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='1']
##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 1

Updating file refs in test/

This revision is now accepted and ready to land.Mar 30 2023, 22:43