practica icon indicating copy to clipboard operation
practica copied to clipboard

test(e2e): used private npm registry to test our CLI

Open rluvaton opened this issue 3 years ago • 3 comments

Replace npm linking with actual private npm registry for our CLI e2e testing.

This has a couple of advantages:

  1. Not using linking which can have problems (if wanted I can elaborate more)
  2. Using actual registry like in prod
  3. We also test our publish
  4. Using it like real world users

Note: this does not publish the internal packages as well (e.g. logger, configuration-provider, etc), this can be done...

rluvaton avatar Aug 14 '22 00:08 rluvaton

Codecov Report

Base: 90.92% // Head: 90.92% // No change to project coverage :thumbsup:

Coverage data is based on head (9e9819d) compared to base (487b4a1). Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #203   +/-   ##
=======================================
  Coverage   90.92%   90.92%           
=======================================
  Files          16       16           
  Lines         595      595           
  Branches       43       42    -1     
=======================================
  Hits          541      541           
  Misses         53       53           
  Partials        1        1           
Flag Coverage Δ
app 91.97% <ø> (ø)
generator 63.63% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Aug 14 '22 00:08 codecov[bot]

For some reason it fails for me locally, would love if you could try to run this e2e tests locally:

Error: Command failed with exit code 1: npx @practica/create-node-app immediate --install-dependencies
❣️ Command failed: npx turbo run build
 WARNING  cannot find a .git folder. Falling back to manual file hashing (which may be slower). If you are running this build in a pruned directory, you can ignore this message. Otherwise, please initialize a git repository in the root of your monorepo
@practica/logger:build: ERROR: command finished with error: command (libraries/logger) npm run build exited (1)
command (libraries/logger) npm run build exited (1)

• Packages in scope: @practica/configuration-provider, @practica/error-handling, @practica/jwt-token-verifier, @practica/logger, @practica/validation, order-service
• Running build in 6 packages
@practica/configuration-provider:build: cache miss, executing 18c6dc842ef9d06c
@practica/validation:build: cache miss, executing aa62be4c47b969dd
@practica/jwt-token-verifier:build: cache miss, executing 8f29359f1a7672e9
@practica/jwt-token-verifier:build: 
@practica/jwt-token-verifier:build: > @practica/[email protected] build
@practica/jwt-token-verifier:build: > tsc
@practica/jwt-token-verifier:build: 
@practica/validation:build: 
@practica/validation:build: > @practica/[email protected] build
@practica/validation:build: > tsc
@practica/validation:build: 
@practica/configuration-provider:build: 
@practica/configuration-provider:build: > @practica/[email protected] build
@practica/configuration-provider:build: > tsc
@practica/configuration-provider:build: 
@practica/logger:build: cache miss, executing 3f7e37ba54fced5a
@practica/logger:build: 
@practica/logger:build: > @practica/[email protected] build
@practica/logger:build: > tsc
@practica/logger:build: 
@practica/logger:build: logger.wrapper.ts(2,10): error TS2614: Module '"./pino.logger"' has no exported member 'PinoLogger'. Did you mean to use 'import PinoLogger from "./pino.logger"' instead?
@practica/logger:build: npm ERR! Lifecycle script `build` failed with error: 
@practica/logger:build: npm ERR! Error: command failed 
@practica/logger:build: npm ERR!   in workspace: @practica/[email protected] 
@practica/logger:build: npm ERR!   at location: /private/var/folders/2k/nrstj_mn1b7__x9j3mzj8s040000gn/T/practica-tests-output/C1ZUDY/default-app-name/libraries/logger 
@practica/logger:build: 

 Tasks:    3 successful, 4 total
Cached:    0 cached, 4 total
  Time:    7.394s 



    at makeError (/Users/rluvaton/dev/open-source/practicajs/practica/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/Users/rluvaton/dev/open-source/practicajs/practica/node_modules/execa/index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.<anonymous> (/Users/rluvaton/dev/open-source/practicajs/practica/test/e2e-flow.slow.test.ts:42:5)

rluvaton avatar Aug 14 '22 00:08 rluvaton

@rluvaton Summarizing here our phone call conclusions:

  • We will first use verdacio per-library only, each lib will test itself E2E with real publishing using verdacio
  • For a start, we won't change the linking
  • With time, we will gain more knowledge and confidence about our desired linking approach (e.g., which workspace to use, how) and then we will get back to this

goldbergyoni avatar Sep 29 '22 07:09 goldbergyoni