Hi,
I’m currently doing GitLab Course. And while deploying facing issue related “mocha app-test.js --timeout 10000 --reporter mocha-junit-reporter --exit”. MongoDB database connected but job getting fail because of report.
Please find below CI logs:
Executing “step_script” stage of the job script00:14
Using effective pull policy of [always] for container node:17-alpine3.14
Using docker image sha256:b20b24e39dda538a41dfa3e9fcd7d70479cad96e3aa7324a0fc7fd1eacd8de45 for node:17-alpine3.14 with digest node@sha256:0d8276c8e82fa717a9a88b8734bbad60ac29a0f15f9d04acbe8dd16a850f783c …
$ npm install
added 364 packages, and audited 365 packages in 8s
44 packages are looking for funding
run npm fund for details
19 vulnerabilities (5 low, 5 moderate, 6 high, 3 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run npm audit for details.
$ npm test
Solar [email protected] test
mocha app-test.js --timeout 10000 --reporter mocha-junit-reporter --exit
Server successfully running on port - 3000
Cleaning up project directory and file based variables00:01
ERROR: Job failed: exit code 8
===========================
CI Pipeline:
workflow:
name: Solar System NodeJS Pipeline
rules:
- if: ‘$CI_COMMIT_BRANCH == “main” || $CI_COMMIT_BRANCH =~ /^feature/’
when: always
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^feature/ && $CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
stages:
- test
variables:
MONGO_URI: mongodb+srv://superadmin:[email protected]/solar-db
MONGO_USER: superadmin
MONGO_PASSWORD: SuperUser
unit_testing:
stage: test
image: node:17-alpine3.14
before_script:
- npm install
script:
- npm test
Please help to find the issue.