Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Git Error When Sending Coverage Report #87

Closed
@eiskalteschatten

Description

@eiskalteschatten

node.js Version (2.5.x / etc)

12.12.0 and 12.13.0

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

macOS 10.15

Testing framework

Jest

Expected Behavior

  1. Tests run and generate an LCov coverage report.
  2. The coverage report is sent to Codacy.

Actual Behavior

Locally, it works just fine. I am able to run my tests and send the coverage report to Codacy without a problem, but on the server I get an inexplicable error that I have no idea how to solve. The following is the log output with the --debug flag set:

[info] "2019-10-22T08:34:58.607Z"  'Started with: token [undefined], accountToken [undefined], username [undefined], projectName [undefined], commitId [undefined], language [undefined], endpoint [undefined], format [undefined], path prefix ["."], verbose [undefined], debug [true]'
[trace] "2019-10-22T08:34:58.611Z"  'Got chunk'
[trace] "2019-10-22T08:34:58.613Z"  'Received file through stdin'
[info] "2019-10-22T08:34:58.613Z"  'Handling input for: token ["TOKEN REDACTED"], accountToken [undefined], username [undefined], projectName [undefined], commitId [undefined], language [undefined], endpoint [undefined], format ["lcov"], path prefix ["."], verbose [undefined], debug [true]'
[debug] "2019-10-22T08:34:58.616Z"  'Parsing Lcov Data'
[trace] "2019-10-22T08:34:58.649Z"  'Successfully parsed /app/src/app.ts'
... (all files successfully parsed)
[debug] "2019-10-22T08:34:58.664Z"  'Successfully Parsed Lcov Data'
[error] "2019-10-22T08:34:58.670Z"  'Error sending coverage'
[error] "2019-10-22T08:34:58.671Z"  Error: Command failed: git rev-parse HEAD
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:430:11)
    at Socket.emit (events.js:210:5)
    at Pipe.<anonymous> (net.js:658:12) {
  killed: false,
  code: 128,
  signal: null,
  cmd: 'git rev-parse HEAD'
}

This is the command I used to run it:

cat ./test-coverage/lcov.info | codacy-coverage -p . --debug

I've tried it both with and without the -p flag.

Why would it try to do anything with git?!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions