Verdaccio for E2E Testing: Don’t ruin your publishings
Juan Picado will explain how to test publishing Node.js packages in a local registry integrated in your CI.
A brief introduction to Verdaccio and then he will show us the steps to how to integrate Verdaccio in your E2E pipeline. We will see how React (create-react-app) and Angular (CLI) are using Verdaccio in production environments.
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
What can possibly go wrong if i dont e2 e test my packages?
1. What can possibly go wrong if I
don’t E2E test my packages?
Juan Picado
Core Team - Verdaccio
Node.js Meetup - Berlin, 2019
2. Senior Front-End Engineer at eBay
@jotadeveloper
@juanpicado
● Joined Verdaccio August 2016
● I love Open Source
● I do Node.js just for fun
● I like write documentation
3. Objective
● Brief Introduction to Verdaccio
● Create awareness about possible mistakes on
publishing packages
● How others are doing it?
● What measures we might take in order to avoid issues
4. How to install Verdaccio?
A lightweight proxy and private registry for Node.js
https://bit.ly/2KMkNW8
5.
6. End to End Testing
End-to-end testing is a technique used to test whether the
entire application flow behaves as expected from start to
finish
https://ebaytech.berlin/100-percent-test-coverage-is-not-enough-3d733551bc3f
7. End to End Testing
Tests that simulate real user scenarios can easily help to
determine how a failing test would impact the user.
https://ebaytech.berlin/100-percent-test-coverage-is-not-enough-3d733551bc3f
15. ● Dependencies removed from the registry
○ npmjs provides 72h window to remove pkgs (immutable)
○ private registries do not follow this rule (mutable)
https://github.com/ljharb
Missing dependencies
Jordan Harband
24. @angular-cli
● Command Line Tool (scaffolds apps and libraries)
● Monorepo based on @angular-devkit
○ Similar to lerna structure
● Use yarn workspaces
● Custom build setup (no Jest or similar)
30. ● Special local build for E2E
● Using absolute paths for dependencies
○ No semver
○ No guarantee the local dependencies and their
transitive dependencies were used
● Unable to test the ng update command
● Some tests always tested last publish
Which issues angular cli was having?
@angular-cli
34. Verdaccio integration at @angular/cli
1. Spawn verdaccio
2. Custom build read all tests
3. Build local packages
4. Local Publish (+build) to Verdaccio (@angular/dev-kit)
5. Create a test project with ng CLI (fetching from verdaccio)
6. Run all tests in serie
@angular-cli
45. Verdaccio integration at create-react-app
1. Bootstrap verdaccio (bash script)
2. Build all packages
3. Publish on Verdaccio with Lerna
4. Run npx create-react-app test-app
i. Build the app
ii. Run smoke tests
iii. Verify internal stuff and clean up
@create-react-app
53. ● Intense Code Reviews (config files that affect packages)
● Publish to a local registry in each PR
● Perform a real installation
● Run smoke tests
● Ensure you are testing the user behaviour
● Rely real tooling (npm, npx, yarn, etc...)