Hey guys,
I tried to configure a new project to load a repository from Github with my automated tests written in Cypress. Of course, I didn’t insert node_modules because of their size, so in the build steps I gave it to execute a shell command such as npm install (to install the modules needed for Cypress) and npm run checkbox (the command to run the automated test, defined in package.json/scripts). Unfortunately, however, it throws me the following error: Build step ‘Execute shell’ marked build as failure. Do any of you perhaps know what could be the cause? I think I’ve looked everywhere…
Here is console output:
Started by user Dawid Łaciak
Running as SYSTEM
Building in workspace C:\Users\dawid\.jenkins\workspace\Cypress Automated Tests
The recommended git tool is: NONE
No credentials specified
> C:\Program Files\Git\bin\git.exe rev-parse --resolve-git-dir C:\Users\dawid\.jenkins\workspace\Cypress Automated Tests\.git # timeout=10
Fetching changes from the remote Git repository
> C:\Program Files\Git\bin\git.exe config remote.origin.url https://github.com/dawidlaciak/automated-tests.git # timeout=10
Fetching upstream changes from https://github.com/dawidlaciak/automated-tests.git
> C:\Program Files\Git\bin\git.exe --version # timeout=10
> git --version # 'git version 2.47.1.windows.1'
> C:\Program Files\Git\bin\git.exe fetch --tags --force --progress -- https://github.com/dawidlaciak/automated-tests.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/main^{commit}" # timeout=10
Checking out Revision abc40e700a39cacd40ec88bdb9e1eb8e436e356e (refs/remotes/origin/main)
> C:\Program Files\Git\bin\git.exe config core.sparsecheckout # timeout=10
> C:\Program Files\Git\bin\git.exe checkout -f abc40e700a39cacd40ec88bdb9e1eb8e436e356e # timeout=10
Commit message: "Automated Cypress Tests"
> C:\Program Files\Git\bin\git.exe rev-list --no-walk abc40e700a39cacd40ec88bdb9e1eb8e436e356e # timeout=10
[Cypress Automated Tests] $ /bin/sh C:\Users\dawid\AppData\Local\Temp\jenkins4979169135057120745.sh
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:500)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
Caused: java.io.IOException: Cannot run program "/bin/sh" (in directory "C:\Users\dawid\.jenkins\workspace\Cypress Automated Tests"): CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
at hudson.Proc$LocalProc.<init>(Proc.java:252)
at hudson.Proc$LocalProc.<init>(Proc.java:221)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:994)
at hudson.Launcher$ProcStarter.start(Launcher.java:506)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:144)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:92)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:164)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:527)
at hudson.model.Run.execute(Run.java:1831)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:445)
Build step 'Execute shell' marked build as failure
Finished: FAILURE
The error is completely different now. Seems to be not related to Jenkins.
C:\Users\dawid\.jenkins\workspace\Testy automatyczne w Cypress>npm install
npm error Class extends value undefined is not a constructor or null
npm error A complete log of this run can be found in: C:\Users\dawid\AppData\Local\npm-cache\_logs\2024-12-26T09_03_39_062Z-debug-0.log
Okay, so I have no idea what is going on. Now I changed it back to “Execute Shell” and used it with the same commands as before and it passed, but I didn’t receive any output about result of tests (command npm run checkbox).