/drone/src is a volume that persists between steps in the same pipeline which means the node_modules folder is available to subsequent steps . I created a simple test and was unable to reproduce the issue you are describing . I can confirm there have been no changes or regressions that would prevent this from working as expected.
I have attached a screenshot below that demonstrates my successful test. I have also included links below so that you can see our sample code and configuration, and compare with your own.
The only root cause I am aware of for the issue you described would be yaml misconfiguration. We are happy to help advise, but would kindly request a sample yaml and repository that we can use to reproduce the problem (similar to the sample repository and yaml we provided at the links below).
I am not aware of any instance in which the shared folder would be missing (unless you somehow added a yaml configuration that accidentally conflicted with the shared folder). The shared folder contains the source code cloned from your git repository. If the shared folder was missing, your source code would be missing too.
If the shared folder were missing, and your source code was missing, the npm install would fail due to missing package.json file. This does not seem to be the case based on the error message in your screenshot.
there is a package-lock.json file since we run npm ci for all our pipelines. the thing is it doesn’t happen all the time. it might happen once \ twice a day or 15 times a day. also, it’s not always jest module but others as well.
as for now, I have 2 guesses -
we do something wrong on the pipeline level.
nodes having issues passing this sharing folder between steps.