Move cypress out of the deployment pipeline

Jamie Wen
1 min readJul 1, 2021

--

To reduce the time it takes to deploy to production

How long it takes to install cypress on my Mac?

%> time npm i cypress
%> npm i cypress 22.37s user 43.71s system 67% cpu 1:37.45 total

One and a half minutes. It might take longer on your build agents.

How can I move cypress out of my deployment pipeline? Move it to devDependenciesn and just do npm install --production? What if you need to run eslint, prettier, and other dev tools in your pipeline?

How can I move it out of the root `package.json` completely?

Create a delegated package.json in its own folder.

…install with prefix only when you need it. eg. In your scheduled pipeline for e2e test cases.

npm install --prefix cypress

Why does one and a half minutes matter?

If you live in a continuous deployment world, your team will probably deploy multiple times a day. 1.5 minutes per build makes a difference.

--

--

Jamie Wen
Jamie Wen

Written by Jamie Wen

Software Engineer | Technical Lead | Engineering Manager https://justlearning.club

No responses yet