Can you advise me on the no such file or directory error that i am encountering when I run the process to execute cypress tests directly on worker(ubuntu) or when the process is called via docker container to run run on worker.
Thanks for reaching out, and sorry to hear you are having trouble using Cypress/Inline-Assets in Octopus Deploy, but I would be happy to help take a closer look.
As an initial step, could you share the latest script you are running here so I can review it? This will provide a bit more insight into the output you are getting.
Here is a secure link to drop this, so you don’t have to post it to the public forum.
Just stepping in for Britton while he’s offline, confirming we have received the log file ok!
From a quick look it seems that the /e2e folder might not be residing in the work folder /etc/octopus/Cypress-worker/Work/20230323152534-52971-2338 and so it’s failing to run the chmod command (along with other errors) from the context where the Script.sh is executed:
chmod: cannot access '/etc/octopus/Cypress-worker/Work/20230323152534-52971-2338/e2e/node_modules/inline-assets/bin/inline-assets.js': No such file or directory
Could you please confirm the location of the /e2e folder and either relocate it or adjust any scripts to reference that location? We’d be happy to help with this if you’d like to send any scripts or deployment process through!
Let me know if that’s not the case and I’d be happy to dig into it further, feel free to reach out if you have any questions at all!
Just to add more info here - I am running same set of tests with hardcoded URL and cred’s to the application on the same project which runs successfully and html files are created.
Issue is when I try to use substitute variables and variables substituted into cypress .js and .cy.js files where docker build is successful but docker run would fail looking for actual URL instead of variable.
Thank you for the updates, and I’m sorry to hear you are still having trouble with your Cypress deployment process in Octopus Deploy, but I would be happy to continue helping.
In taking a look through things this morning, I did notice one more line in the log that might be causing issues:
15:25:38 Verbose | Parsing file '/etc/octopus/[redacted]/Work/[redacted]/[redacted]/cypress.config.js' with Octostache returned the following error: `The following tokens were unable to be evaluated: '#{WebsiteName.DataServices}'`
Would this variable evaluation issue have anything to do with the problem you are seeing?
Outside of this, I would recommend adding some sleep steps to your process in Octopus Deploy so you can manually inspect things as they sit in the container during a deployment - from here, you should be able to try running the same commands that your Octopus process is, and hopefully this will shed some light on what’s happening here.
I hope this helps, but let me know what you find out in your testing.