I'm new to git CI and I'm trying to create a pipeline for a school project. I need to run some tests with Cypress through the CI but I get an Error: spawn ps ENOENT.
The CI job:
cypress-test-job:
image: cypress/browsers:node16.14.0-slim-chrome99-ff97
stage: test
script:
- cd frontend-webpack/
- echo "Testing frontend with Cypress"
- npm ci
- npm run test
- echo "Testing complete"
My package.json:
{
"name": "seminar-week5-client",
"version": "1.0.0",
"description": "",
"main": "index.html",
"scripts": {
"build": "npx webpack-cli",
"build:dev": "npx webpack-cli --mode=development",
"start": "npx webpack serve",
"watch": "npx webpack serve",
"lint": "npx eslint src/**.js src/js/**.js",
"cy:test": "npx cypress run",
"test:headless": "npx cypress run --spec cypress/integration/ToDo_tests.js",
"test": "start-server-and-test start http-get://localhost:8080 cy:test"
},
"author": "",
"license": "ISC",
"dependencies": {
"jquery": "^3.3.1",
"lodash": "^4.17.11",
"sass": "^1.49.11",
"wait-on": "^6.0.1"
},
"devDependencies": {
"babel-loader": "^8.2.4",
"css-loader": "^6.7.1",
"cypress": "^9.5.3",
"eslint": "^8.12.0",
"eslint-webpack-plugin": "^3.1.1",
"html-loader": "^3.1.0",
"html-webpack-plugin": "^5.5.0",
"sass-loader": "^12.6.0",
"start-server-and-test": "^1.14.0",
"style-loader": "^3.3.1",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.0"
}
}
The failed output of the pipeline:
Running with gitlab-runner 14.9.0~beta.68.g1283960c (1283960c)
on green-4.shared.runners-manager.gitlab.com/default ntHFEtyX
Resolving secrets
00:00
Preparing the "docker+machine" executor
00:41
Using Docker executor with image cypress/browsers:node16.14.0-slim-chrome99-ff97 ...
Pulling docker image cypress/browsers:node16.14.0-slim-chrome99-ff97 ...
Using docker image sha256:beaac0b58885bf17f2b91ce142daaed6658aaee184bff7c8f114e2210db567cc for cypress/browsers:node16.14.0-slim-chrome99-ff97 with digest cypress/browsers@sha256:e55e133a7b66e1e0fd13b8e7db1f545771ed3a98f76fc662fce268d02ab0aff9 ...
Preparing environment
00:02
Running on runner-nthfetyx-project-34382765-concurrent-0 via runner-nthfetyx-shared-1649414442-4ad4be93...
Getting source from Git repository
00:12
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 20...
Initialized empty Git repository in /builds/saxion.nl/hbo-ict/development-tools/web/38/.git/
Created fresh repository.
Checking out 8c002ea2 as master...
Skipping Git submodules setup
Executing "step_script" stage of the job script
02:45
Using docker image sha256:beaac0b58885bf17f2b91ce142daaed6658aaee184bff7c8f114e2210db567cc for cypress/browsers:node16.14.0-slim-chrome99-ff97 with digest cypress/browsers@sha256:e55e133a7b66e1e0fd13b8e7db1f545771ed3a98f76fc662fce268d02ab0aff9 ...
$ cd frontend-webpack/
$ echo "Testing frontend with Cypress"
Testing frontend with Cypress
$ npm ci
added 624 packages, and audited 625 packages in 55s
78 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ npm run test
> seminar-week5-client@1.0.0 test
> start-server-and-test start http-get://localhost:8080 cy:test
1: starting server using command "npm run start"
and when url "[ 'http-get://localhost:8080' ]" is responding with HTTP status code 200
running tests using command "npm run cy:test"
> seminar-week5-client@1.0.0 start
> npx webpack serve
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:8080/
<i> [webpack-dev-server] Content not from webpack is served from '/builds/saxion.nl/hbo-ict/development-tools/web/38/frontend-webpack/src' directory
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
[BABEL] Note: The code generator has deoptimised the styling of /builds/saxion.nl/hbo-ict/development-tools/web/38/frontend-webpack/node_modules/lodash/lodash.js as it exceeds the max of 500KB.
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
<i> [webpack-dev-middleware] wait until bundle finished: /
asset app.bundle.js 2.19 MiB [emitted] [minimized] [big] (name: main) 1 related asset
asset a5441281b140aaf5cb21.png 80.6 KiB [emitted] [immutable] [from: src/images/delete.png] (auxiliary name: main)
asset index.html 419 bytes [emitted]
runtime modules 27.5 KiB 13 modules
orphan modules 19.9 KiB [orphan] 9 modules
javascript modules 987 KiB
modules by path ./node_modules/ 980 KiB
modules by path ./node_modules/style-loader/dist/runtime/*.js 5.75 KiB 6 modules
modules by path ./node_modules/webpack-dev-server/client/ 56.8 KiB 4 modules
modules by path ./node_modules/webpack/hot/*.js 4.4 KiB 4 modules
modules by path ./node_modules/html-entities/lib/*.js 115 KiB 4 modules
modules by path ./node_modules/css-loader/dist/runtime/*.js 3.52 KiB 3 modules
+ 4 modules
modules by path ./src/ 6.81 KiB
./src/app.js + 1 modules 2.64 KiB [built] [code generated]
./src/styles/appStyle.scss 2.41 KiB [built] [code generated]
./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/appStyle.scss 1.76 KiB [built] [code generated]
./src/images/delete.png 42 bytes (javascript) 80.6 KiB (asset) [built] [code generated]
webpack 5.72.0 compiled successfully in 19130 ms
> seminar-week5-client@1.0.0 cy:test
> npx cypress run
[STARTED] Task without title.
[SUCCESS] Task without title.
[310:0408/104418.838935:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[310:0408/104418.839032:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[310:0408/104418.846171:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[475:0408/104418.911107:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is
tput: unknown terminal "xterm npm_config_loglevel warn npm_config_unsafe_perm true"
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 9.5.3 │
│ Browser: Electron 94 (headless) │
│ Node Version: v16.14.0 (/usr/local/bin/node) │
│ Specs: 1 found (ToDo_tests.js) │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: ToDo_tests.js (1 of 1)
[310:0408/104421.132271:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
My ToDo list
✓ can add new todo items (10167ms)
✓ can remove todo items (7887ms)
✓ Try adding duplicate item (3738ms)
✓ Delete the rest (2554ms)
4 passing (25s)
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 4 │
│ Passing: 4 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: true │
│ Duration: 24 seconds │
│ Spec Ran: ToDo_tests.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(Video)
- Started processing: Compressing to 32 CRF
Compression progress: 68%
- Finished processing: /builds/saxion.nl/hbo-ict/development-tools/web/38/frontend (20 seconds)
-webpack/cypress/videos/ToDo_tests.js.mp4
Compression progress: 100%
tput: unknown terminal "xterm npm_config_loglevel warn npm_config_unsafe_perm true"
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ ToDo_tests.js 00:24 4 4 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! 00:24 4 4 - - -
node:events:498
throw er; // Unhandled 'error' event
^
Error: spawn ps ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn ps',
path: 'ps',
spawnargs: [ '-A', '-o', 'ppid,pid,stat,comm' ]
}
Uploading artifacts for failed job
00:02
Uploading artifacts...
frontend-webpack/cypress/videos/*.mp4: found 1 matching files and directories
Uploading artifacts as "archive" to coordinator... 201 Created id=2310380359 responseStatus=201 Created token=gaMq6mXk
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1