nestjs / nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
https://nestjs.com
MIT License
67.29k stars 7.59k forks source link

Error when trying to create a coverage report #11573

Closed fernandortec closed 1 year ago

fernandortec commented 1 year ago

Is there an existing issue for this?

Current behavior

I have made all the necessary steps to run the app according to the CONTRIBUTING.md file. But when I try to run npm run coverage to look at the coverage report that it generates, I receive an error:

Coverage error

`

@nestjs/core@9.4.0 coverage nyc report --reporter=text-lcov | coveralls

[error] "2023-04-27T22:09:04.121Z" 'error from lcovParse: ' 'Failed to parse string' [error] "2023-04-27T22:09:04.123Z" 'input: ' '' [error] "2023-04-27T22:09:04.123Z" 'error from convertLcovToCoveralls'

/Users/fernandortec/Desktop/coding/study-projects/nest/node_modules/coveralls/bin/coveralls.js:19 throw err; ^ Failed to parse the string (Use node --trace-uncaught ... to show where the exception was thrown) `

I looked at the line of code inside node_modules that was throwing the error and apparently, the input coveralls receives is empty, however, I have no idea where this input should come from

Minimum reproduction code

https://github.com/nestjs/nest

Steps to reproduce

  1. npm ci
  2. sh scripts/prepare.sh
  3. npm run build
  4. sh scripts/run-integration.sh
  5. npm run coverage

Expected behavior

When I run the coverage script, it should generate a coverage report so that I can see the test information on the project

Package

Other package

nyc, coveralls

NestJS version

No response

Packages versions

"dependencies": {
    "@nuxtjs/opencollective": "0.3.2",
    "class-transformer": "0.5.1",
    "class-validator": "0.14.0",
    "cli-color": "2.0.3",
    "cors": "2.8.5",
    "express": "4.18.2",
    "fast-json-stringify": "5.7.0",
    "fast-safe-stringify": "2.1.1",
    "graphql-subscriptions": "2.0.0",
    "iterare": "1.2.1",
    "object-hash": "3.0.0",
    "path-to-regexp": "3.2.0",
    "reflect-metadata": "0.1.13",
    "rxjs": "7.8.0",
    "socket.io": "4.6.1",
    "tslib": "2.5.0",
    "uid": "2.0.2",
    "uuid": "9.0.0"
  },
  "devDependencies": {
    "@apollo/server": "4.7.0",
    "@codechecks/client": "0.1.12",
    "@commitlint/cli": "17.6.1",
    "@commitlint/config-angular": "17.6.1",
    "@fastify/cors": "^8.0.0",
    "@fastify/formbody": "7.4.0",
    "@fastify/middie": "8.1.0",
    "@fastify/multipart": "7.6.0",
    "@fastify/static": "6.10.1",
    "@fastify/view": "7.4.1",
    "@grpc/grpc-js": "1.8.14",
    "@grpc/proto-loader": "0.7.6",
    "@nestjs/apollo": "11.0.5",
    "@nestjs/graphql": "11.0.5",
    "@nestjs/mongoose": "9.2.2",
    "@nestjs/typeorm": "9.0.1",
    "@types/amqplib": "0.10.1",
    "@types/bytes": "3.1.1",
    "@types/chai": "4.3.4",
    "@types/chai-as-promised": "7.1.5",
    "@types/cors": "2.8.13",
    "@types/express": "4.17.17",
    "@types/gulp": "4.0.10",
    "@types/http-errors": "2.0.1",
    "@types/mocha": "10.0.1",
    "@types/node": "18.16.1",
    "@types/sinon": "10.0.14",
    "@types/supertest": "2.0.12",
    "@types/ws": "8.5.4",
    "@typescript-eslint/eslint-plugin": "4.33.0",
    "@typescript-eslint/parser": "4.33.0",
    "amqp-connection-manager": "4.1.12",
    "amqplib": "0.10.3",
    "artillery": "1.7.9",
    "body-parser": "1.20.2",
    "bytes": "3.1.2",
    "cache-manager": "5.2.1",
    "cache-manager-redis-store": "3.0.1",
    "chai": "4.3.7",
    "chai-as-promised": "7.1.1",
    "clang-format": "1.8.0",
    "commitlint-circle": "1.0.0",
    "concurrently": "8.0.1",
    "conventional-changelog": "3.1.25",
    "core-js": "3.30.1",
    "coveralls": "3.1.1",
    "delete-empty": "3.0.0",
    "engine.io-client": "6.4.0",
    "eslint": "7.32.0",
    "eslint-config-prettier": "8.8.0",
    "eslint-plugin-import": "2.27.5",
    "eventsource": "2.0.2",
    "fancy-log": "2.0.0",
    "fastify": "4.16.0",
    "graphql": "16.6.0",
    "graphql-tools": "8.3.20",
    "gulp": "4.0.2",
    "gulp-clang-format": "1.0.27",
    "gulp-clean": "0.4.0",
    "gulp-sourcemaps": "3.0.0",
    "gulp-typescript": "5.0.1",
    "gulp-watch": "5.0.1",
    "http-errors": "2.0.0",
    "husky": "8.0.3",
    "imports-loader": "4.0.1",
    "ioredis": "5.3.2",
    "json-loader": "0.5.7",
    "kafkajs": "2.2.4",
    "lerna": "2.11.0",
    "lerna-changelog": "2.2.0",
    "light-my-request": "5.9.1",
    "lint-staged": "13.2.1",
    "markdown-table": "2.0.0",
    "merge-graphql-schemas": "1.7.8",
    "mocha": "10.2.0",
    "mongoose": "7.0.5",
    "mqtt": "4.3.7",
    "multer": "1.4.4",
    "mysql2": "3.2.4",
    "nats": "2.13.1",
    "nodemon": "2.0.22",
    "nyc": "15.1.0",
    "prettier": "2.8.8",
    "redis": "4.6.5",
    "rxjs-compat": "6.6.7",
    "sinon": "15.0.4",
    "sinon-chai": "3.7.0",
    "socket.io-client": "4.6.1",
    "subscriptions-transport-ws": "0.11.0",
    "supertest": "6.3.3",
    "ts-morph": "18.0.0",
    "ts-node": "10.9.1",
    "typeorm": "0.3.15",
    "typescript": "5.0.4",
    "wrk": "1.2.1",
    "ws": "8.13.0"
  },

Node.js version

16.14.2

In which operating systems have you tested?

Other

No response

jmcdo29 commented 1 year ago

Try it without the pipe to coveralls. No need to send the coverage data when reading locally, right?

fernandortec commented 1 year ago

@jmcdo29 When I do that, it works, but the index.html in the coverage folder has no available data on the tests

image

kamilmysliwiec commented 1 year ago

Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.