Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Issue 1281 warning on no write #5584

Closed

Conversation

Toxicable
Copy link
Contributor

@Toxicable Toxicable commented Nov 2, 2019

User facing changelog

Cypress no longer requires write access to the projectRoot, it instead will display a warning.

Additional details

This allows for cypress inetegration with other tools such as Bazel

How has the user experience changed?

It allows Cypress to be run in sandboxed or otherwise readonly fs environments

PR Tasks

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 2, 2019

Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.

  • Please write [WIP] in the title of your Pull Request if your PR is not ready for review - someone will review your PR as soon as the [WIP] is removed.
  • Please familiarize yourself with the PR Review Checklist and feel free to make updates on your PR based on these guidelines.

PR Review Checklist

If any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'.

User Experience

  • The feature/bugfix is self-documenting from within the product.
  • The change provides the end user with a way to fix their problem (no dead ends).

Functionality

  • The code works and performs its intended function with the correct logic.
  • Performance has been factored in (for example, the code cleans up after itself to not cause memory leaks).
  • The code guards against edge cases and invalid input and has tests to cover it.

Maintainability

  • The code is readable (too many nested 'if's are a bad sign).
  • Names used for variables, methods, etc, clearly describe their function.
  • The code is easy to understood and there are relevant comments explaining.
  • New algorithms are documented in the code with link(s) to external docs (flowcharts, w3c, chrome, firefox).
  • There are comments containing link(s) to the addressed issue (in tests and code).

Quality

  • The change does not reimplement code.
  • There's not a module from the ecosystem that should be used instead.
  • There is no redundant or duplicate code.
  • There are no irrelevant comments left in the code.
  • Tests are testing the code’s intended functionality in the best way possible.

Internal

  • The original issue has been tagged with a release in ZenHub.

@CLAassistant
Copy link

CLAassistant commented Nov 2, 2019

CLA assistant check
All committers have signed the CLA.

@jennifer-shehane jennifer-shehane requested review from a team and removed request for a team December 19, 2019 05:59
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Toxicable, sorry for the delay in responding. Thanks for the contribution. We will need some tests written to verify this new behavior.

There is a Contributing guide that covers how to contribute and get Cypress running locally here: https://github.com/cypress-io/cypress/blob/develop/.github/CONTRIBUTING.md

Let us know if you have trouble getting the tests running locally.

@Toxicable
Copy link
Contributor Author

@jennifer-shehane Hey, thanks for the reply, I've tried getting the tests running locally both on windows and ubuntu but both times im getting a whole bunch of unit testing failures from path mis-matches to different shaped objects.

As for writing the unit test for this specific case itself. All that needs to be done is a file system needs to be created in readonly mode, then cypress needs to execute with the projectRoot pointing to this readonly file system. Finally asserting that this warning is displayed and that it can continue executing.

Are there any existing tests similar to this that I could use an example for how to set this up?

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Jan 10, 2020

@Toxicable you may need to follow these instructions for contributing in Windows. https://github.com/cypress-io/cypress/blob/develop/CONTRIBUTING.md#getting-started

Although I'm not sure why things would fail in Ubuntu specifically.

Normally we have e2e tests with snapshots for error messages from server package. For example, this is a test of the error message above the one you added https://github.com/cypress-io/cypress/blob/develop/packages/server/test/e2e/2_cdp_spec.ts#L9:L9

I'm adding [WIP] to the title of this PR. Please remove this when you are ready for rereview.

@jennifer-shehane jennifer-shehane changed the title Issue 1281 warning on no write [WIP] Issue 1281 warning on no write Jan 10, 2020
@Toxicable Toxicable force-pushed the issue-1281-warning-on-no-write branch from 3ea7e17 to f86b834 Compare February 1, 2020 22:15
@Toxicable
Copy link
Contributor Author

@jennifer-shehane I added a test but struggling to get it to working as expected.
As you can see by the snapshot it's throwing the error that it cant find my spec files.
I don't understand why it cant find them since the projectDir path definately has the correct file.
If I remove all the read only chmodSync calls it still cant find the spec file.
Does project from the configuration object not set the dir that it should run in this testing suite?

This change replaces the error with a warning
when cypress is executing tests in a readonly fs.
@Toxicable Toxicable force-pushed the issue-1281-warning-on-no-write branch from f86b834 to 6652f87 Compare February 1, 2020 22:21
@jennifer-shehane jennifer-shehane requested review from jennifer-shehane, a team and flotwig and removed request for a team February 26, 2020 08:13
@jennifer-shehane
Copy link
Member

Unfortunately we have to close this PR due to inactivity. Please open a new PR addressing the original issue and any requested changes.

@mrmeku
Copy link
Contributor

mrmeku commented Apr 22, 2020

@@jennifer-shehane I'd like to take this PR up and make the additional changes you would need for it to get merged. If you wouldn't mind, could you give some guidance on how to resolve the issue of Cypress not being able to detect spec files that @Toxicable was struggling with?

@mrmeku mrmeku mentioned this pull request Apr 28, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cypress should not require write access of root folder
6 participants