Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coveralls.js no such file or directory #4

Closed
ashleysommer opened this issue Jun 9, 2021 · 6 comments
Closed

coveralls.js no such file or directory #4

ashleysommer opened this issue Jun 9, 2021 · 6 comments

Comments

@ashleysommer
Copy link

-- Pushing coverage to Coveralls.io...
-- Sending ./.coverage to Coveralls.io --
/usr/src/app/entrypoint.sh: line 24: ./node_modules/coveralls/bin/coveralls.js: No such file or directory

my drone step:

- name: coveralls
  image: lizheming/drone-coveralls
  environment:
    COVERALLS_REPO_TOKEN:
      from_secret: coveralls_token
  settings:
    files:
    - ./.coverage
@ashleysommer ashleysommer changed the title converalls.js no such file or directory coveralls.js no such file or directory Jun 9, 2021
@ashleysommer
Copy link
Author

ashleysommer commented Jun 9, 2021

I've found the problem.
Drone starts the container in: /drone/src
But this container assumes the working directory at startup is /usr/src/app (where node_modules lives).

@ashleysommer
Copy link
Author

ashleysommer commented Jun 9, 2021

This is my new drone step that seems to be working:

- name: coveralls
  image: lizheming/drone-coveralls
  environment:
    COVERALLS_SERVICE_NAME: MyRepoName
    COVERALLS_REPO_TOKEN:
      from_secret: coveralls_token
  settings:
    files:
    - /drone/src/.coverage
  commands:
  - export COVERALLS_SERVICE_NUMBER="$DRONE_BUILD_NUMBER"
  - export COVERALLS_SERVICE_JOB_ID="$DRONE_STAGE_NAME"
  - export COVERALLS_SERVICE_JOB_NUMBER="$DRONE_STAGE_NUMBER"
  - export COVERALLS_FLAG_NAME="$DRONE_STAGE_KIND"
  - export COVERALLS_GIT_REPO="$DRONE_REPO_NAME"
  - export COVERALLS_GIT_BRANCH="$DRONE_SOURCE_BRANCH"
  - cd /usr/src/app && /usr/src/app/entrypoint.sh

@ashleysommer
Copy link
Author

ashleysommer commented Jun 10, 2021

Nope, that doesn't work either.
See this section:

for file in $(echo $files | tr -d '[[:space:]]' | tr "," "\n"); do    
    if [[ -f $PWD/$file ]]; then      
        vfiles="$vfiles -f $PWD/$file"            
        echo "-- Sending $file to Coveralls.io --"      
        eval 'cat $PWD/$file | ./node_modules/coveralls/bin/coveralls.js'    
    fi
done

This snippet assumes the file is relative, and is relative to the $PWD which in this case is /usr/src/app

So the file needs to be given as ../../../drone/src/.coverage

@lizheming
Copy link
Owner

Thank you for your point. I'll check and fix it asap!

@ashleysommer
Copy link
Author

My final issue is that I've just realized the coveralls.js tool does not support the .coverage format produced by the python coverage package (coverage.py) (related: coverallsapp/github-action#30):

And the python library has no plans to add the lcov.info support: nedbat/coveragepy#587

So I'm looking at an alternative solution now.

@lizheming
Copy link
Owner

I have fixed the issue like your said. Thank you very much for helping it! Wish you can also resolve your problem~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants