question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

E2E Cypress assets are not restored via cloud cache

See original GitHub issue

Current Behavior

We just enabled NX Cloud cache for a major NG project, with 100s of active developers. build, lint, test and e2e were enabled for distributed cache. Cypress has been configured to dump its video/screenshots in “sanity/” directory in the same directory as “dist/”. Unit test code coverage assets are dumped in “coverage/”. All is good till the CI hits the cache server for the e2e and/or the unit test. If so, e2e and/or unit test will be skipped and the logs are restored as if they ran. However, the assets for the last run that triggered the caching (upload) were not sent to the cloud cache. So, restoring from cache, won’t restore the related artifacts.

Since we need to have access to the “sanity/" and "coverage/” for the last build, but caching did not restore those, our scripts are not able to grab the related info from those directories and do what they need to do with the data. Ex: merge coverage, trend, graph, short-link video, etc.

Therefore the last successful Jenkins build will not have the code coverage percentage calculated, nor has links to e2e videos.

Expected Behavior

Expected behavior would be to have the ability to configure directories and/or files and tag them of a type in the nx.json. This way, when cache of a test is being sent up to the remote server, the specified directory related to tests will go with it. On the way down, the same directories and/or files are restored in-place allowing for internal scripts to do what they need to do with them.

Steps to Reproduce

Create an e2e with cypress and opt in capturing videos … make it hit the cloud cache and restore from it. You’d see that the mp4 videos are missing. Note that the screenshot directories will be configurable in cypress.json.

 "videosFolder": "path/2/videos"
  "screenshotsFolder: path/2/screenshots"

Failure Logs

Not failure logs, except that related data are not restored.

Environment

NX Report complete - copy this into the issue template

@nrwl/angular : 9.5.1 @nrwl/cli : 9.5.1 @nrwl/cypress : 9.5.1 @nrwl/eslint-plugin-nx : 9.5.1 @nrwl/express : Not Found @nrwl/jest : 9.5.1 @nrwl/linter : 9.5.1 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/react : Not Found @nrwl/schematics : Not Found @nrwl/tao : 9.5.1 @nrwl/web : Not Found @nrwl/workspace : 9.5.1 typescript : 3.8.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
un33kcommented, Dec 10, 2020

I can confirm that NX 11, Beta 16 works with the outputs list. Thx

1reaction
bekoscommented, Dec 9, 2020

@un33k inside the e2e project’s configuration, beside the e2e builder, add the outputs: ["path/2/videos", "path/2/screenshots"]. Doesn’t this work?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Cypress Documentation
Clear Cypress cache. If you're having an issue during installation of Cypress, try removing the contents of the Cypress cache. This will clear...
Read more >
Introduction | Cypress Documentation
Make sure you are not restoring the previous cache using lax keys; then the Cypress binaries can "snowball", read Do Not Let Cypress...
Read more >
Error Messages | Cypress Documentation
To fix this error, follow instructions on caching the cypress binary in CI, then bump the version of your CI cache to ensure...
Read more >
Migration Guide | Cypress Documentation
Migrating to Cypress 12.0 This guide details the changes and how to change your code to migrate to Cypress version 12.0.
Read more >
Changelog - Cypress Documentation
Fixed unexpected behaviors when verifying a cookie was not returned from cy. ... Added support for re-using session data cached by cy.session() across...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found