rsm-hcd / AndcultureCode.Cli

and-cli command-line tool to manage the development of software applications
https://andculture.com
Apache License 2.0
14 stars 15 forks source link

Process execution abstraction #174

Closed brandongregoryscott closed 2 years ago

brandongregoryscott commented 3 years ago

Add Process.spawn wrapper around child_process.spawnSync, refactor existing instances of both spawnSync and shell.exec, export new interfaces and add test coverage

Fixes #160 Abstraction around executing processes

Affected command testing checklist Pretty much any command that ran `shell.exec` or `child_process.spawnSync` manually has been converted over to use the single entry point (`Process.spawn`). Commands that leveraged other operations (such as the `Github` module using the octokit API, or the `copy` command using `shell.cp`, do not need to be tested) - [ ] deploy - [ ] aws-beanstalk - [ ] --dotnet - [ ] --timeout - [ ] --verbose - [ ] aws-s3 - [ ] --destination - [ ] --profile - [ ] --public-url - [ ] --publish - [ ] --source - [ ] --webpack - [ ] --ci - [ ] --skip-clean - [ ] --skip-restore - [ ] azure-storage - [ ] --client-id - [ ] --destination - [ ] --public-url - [ ] --publish - [ ] --recursive - [ ] --secret - [ ] --source - [ ] --tenant-id - [ ] --username - [ ] --webpack - [ ] --ci - [ ] --skip-clean - [ ] --skip-restore - [ ] azure-web-app - [ ] --app-name - [ ] --branch - [ ] --client-id - [ ] --force - [ ] --remote - [ ] --resource-group - [ ] --secret - [ ] --tenant-id - [ ] --username - [x] jenkins - [x] -i, --init - [x] --new - [x] -p, --profile - [x] --show - [x] dotnet-test - [x] --by-project - [x] --ci - [x] --coverage - [x] -s, --skip-clean - [x] dotnet - [x] -b, --build - [x] -c, --clean - [x] -C, --cli - [x] -k, --kill - [x] -p, --publish - [x] -R, --restore - [x] -r, --run - [x] -w, --watch - [x] install - works, with the caveat that the existing bug #136 still exists - [x] migration - [x] -a, --add - [x] -d, --delete - [x] -r, --run - [x] nuget - [x] -p, --publish - [x] -u, --upgrade - [ ] restore - [ ] azure-storage - [ ] --delete-destination - [ ] --destination-account - [ ] --destination-container - [ ] --destination-sas-token - [ ] --recursive - [ ] --source-account - [ ] --source-container - [ ] --source-sas-token - [x] webpack - [x] -c, --clean - [x] -p, --publish - [x] -R, --restore - [x] --ci - not sure if intentional, but this flag is only used in conjunction with `--publish` - we should consider documenting this, or updating the command to allow the flag to run `NodeCI` directly - [x] --skip-clean - Same deal as the ci flag, we should probably document these/update the API to be a little more consistent - [x] --skip-restore - [x] webpack-test - [x] --ci - [x] -c, --clean - [x] -R, --restore - [x] workspace - [x] -c, --clone - [x] -f, --fork - [x] -u, --usernames
codecov[bot] commented 3 years ago

Codecov Report

Merging #174 (b5f62f0) into main (cb9df37) will not change coverage. The diff coverage is 62.19%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #174   +/-   ##
=======================================
  Coverage   74.46%   74.46%           
=======================================
  Files          45       45           
  Lines        1692     1692           
  Branches      289      289           
=======================================
  Hits         1260     1260           
  Misses        424      424           
  Partials        8        8           
Impacted Files Coverage Δ
src/tests/factories/factory-type.ts 100.00% <ø> (ø)
src/tests/test-utils.ts 30.23% <25.00%> (ø)
src/modules/node-ci.ts 31.81% <28.57%> (ø)
src/modules/webpack-publish.ts 47.91% <28.57%> (ø)
src/modules/node-restore.ts 36.36% <40.00%> (ø)
src/modules/dotnet-test.ts 43.30% <50.00%> (ø)
src/modules/dotnet-restore.ts 85.18% <60.00%> (ø)
src/modules/dotnet.ts 82.35% <80.00%> (ø)
src/modules/azcopy-sync.ts 100.00% <100.00%> (ø)
src/modules/dotnet-build.ts 87.09% <100.00%> (ø)
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update cb9df37...b5f62f0. Read the comment docs.