Cypress: Globally installed cypress not finding local project

Created on 3 May 2018  路  6Comments  路  Source: cypress-io/cypress

Current behavior:

When:

  • cypress has been installed globally
  • cypress tests and configs have been generated in the project folder
  • starting a cypress instance from within a project folder via CLI

It:

  • can't find the project immediately

screen shot 2018-05-03 at 12 03 06

Desired behavior:

Expect:

  • cypress to search for configs / tests in its CWD (project folder)
  • offer these to the user instead of making them search through their filesystem

Steps to reproduce:

Install globally with valid integration tests in a local project.

Versions

Cypress 2.1.0 - MacOS - quasar-cli (in development for test mode)

wontfix

Most helpful comment

Global mode works this way in cypress open - even when opening it from a cwd that matches a Cypress project it will still prompt to to click into the project you want to run. However when using cypress run it will start the project automatically.

I don't see the need to make any changes here - once you add your project in global mode it will keep a cache of those paths and display them to you... here's what mine looks like.

screen shot 2018-05-03 at 1 32 49 pm

Also caching the binary will be done - it's being work on by Ben who's sitting right behind me. We've been having weekly conversations about it and it continues to improve and evolve. There's actually quite a lot of complexity around caching but it will be done.

All 6 comments

Can I ask why you want to install cypress globally instead of installing locally within the project?

Cypress works as you describe when locally installed.

Locally (and globally btw) Cypress works great. The issue is that when you are developing multiple projects in multiple repositories ca 300 MB is just not tenable from both a storage and a traffic point of view. I have circa 20 projects that I am working on at any given time (and most of them won't work as monorepos...) If your uplink is fast, then the download time is negligible, but if you for whatever reason have a poor / expensive connection (travelling / 4G / rural), then transit time and cost are very real factors. As a real example: I generally have to wait about 5 minutes for Cypress to finish downloading when I am init'ing a project...

screen shot 2018-05-03 at 18 54 09

Until the global instance of electron cruft lands (which may never happen) I am looking into ways to streamline my usage - and furthermore as a developer working on a project that has thousands of initiated projects every day, anything we can do to streamline our project's (quasar-framework) carbon footprint is definitely a step in the right direction.

Global mode works this way in cypress open - even when opening it from a cwd that matches a Cypress project it will still prompt to to click into the project you want to run. However when using cypress run it will start the project automatically.

I don't see the need to make any changes here - once you add your project in global mode it will keep a cache of those paths and display them to you... here's what mine looks like.

screen shot 2018-05-03 at 1 32 49 pm

Also caching the binary will be done - it's being work on by Ben who's sitting right behind me. We've been having weekly conversations about it and it continues to improve and evolve. There's actually quite a lot of complexity around caching but it will be done.

Thanks for the information - now I know the difference between "open" and "run".

@nothingismagick @Bkucera says you will prove you wrong and finish caching the binary :-P

We know a lot of our users want this. We're doing the "simplest" thing first which is to cache Cypress versions globally and reuse them between all projects.

After that you'll see us do things like caching ffmpeg between versions (to reduce the size of downloads) and then from there do the same thing with electron so that new versions of Cypress will only include the app files + node modules. Should reduce the .zip by like 80-90%. It takes time but we'll get there.

I trust that @Bkucera is fully aware of how awesome it would be to have the binary cache'd outside the local scope of the project - and having a pathway for me to dynamically link an ffmpeg binary (that I have built and trust) would also offload some of the bulk of the package. Of course that would also need to be a different kind of (probably wrapped) install process, because yarn/npm aren't really that "interactive"...

Was this page helpful?
0 / 5 - 0 ratings