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 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.
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"
Not failure logs, except that related data are not restored.
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
Related ticket: https://github.com/nrwl/nx/issues/3977
@un33k you can try to define the desired outputs to your builder. Moving forward Nx will stop "figuring out" outputs and users will have to explicitly declare them in their configuration, so this is towards the correct direction 馃槂
@bekos where is the outputs for e2e video artifacts?
@un33k inside the e2e project's configuration, beside the e2e builder, add the outputs: ["path/2/videos", "path/2/screenshots"]. Doesn't this work?
I can confirm that NX 11, Beta 16 works with the outputs list. Thx