Code Monkey home page Code Monkey logo

coveralls-perl's Introduction

Actions Status Actions Status Actions Status

NAME

Devel::Cover::Report::Coveralls - coveralls backend for Devel::Cover

USAGE

GitHub Actions

1. Add your repo to coveralls. https://coveralls.io/repos/new

2. Add settings to one of your GitHub workflows. Here assuming you're calling it .github/workflows/ci.yml:

jobs:
  ubuntu:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest]
        perl-version: ['5.10', '5.14', '5.20']
        include:
          - perl-version: '5.30'
            os: ubuntu-latest
            release-test: true
            coverage: true
    container: perl:${{ matrix.perl-version }}
    steps:
      - uses: actions/checkout@v2
      # do other stuff like installing external deps here
      - run: cpanm -n --installdeps .
      - run: perl -V
      - name: Run release tests # before others as may install useful stuff
        if: ${{ matrix.release-test }}
        env:
          RELEASE_TESTING: 1
        run: |
          cpanm -n --installdeps --with-develop .
          prove -lr xt
      - name: Run tests (no coverage)
        if: ${{ !matrix.coverage }}
        run: prove -l t
      - name: Run tests (with coverage)
        if: ${{ matrix.coverage }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          cpanm -n Devel::Cover::Report::Coveralls
          cover -test -report Coveralls

3. Push new change to GitHub

4. Coveralls should update your project page

Travis CI

1. Add your repo to coveralls. https://coveralls.io/repos/new

2. Add setting to .travis.yaml (before_install and script section)

language: perl
perl:
  - 5.16.3
  - 5.14.4
before_install:
  cpanm -n Devel::Cover::Report::Coveralls
script:
  perl Build.PL && ./Build build && cover -test -report coveralls

3. push new change to github

4. updated coveralls your project page

another CI

1. Get repo_token from your project page in coveralls.

2. Write .coveralls.yml (don't add this to public repo)

repo_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

3. Run CI.

DESCRIPTION

https://coveralls.io/ is service to publish your coverage stats online with a lot of nice features. This module provides seamless integration with Devel::Cover in your perl projects.

ENVIRONMENT

Set these environment variables to control the behaviour. Various other variables, set by particular CI environments, will be interpreted silently and correctly.

COVERALLS_REPO_TOKEN

The Coveralls authentication token for this particular repo.

COVERALLS_ENDPOINT

If you have an enterprise installation, set this to change from the default of https://coveralls.io. The rest of the URL (/api, etc) won't change, and will be correct.

COVERALLS_FLAG_NAME

Describe the particular tests being done, e.g. Unit or Functional.

COVERALLS_PARALLEL

Set this to true in case you run your tests in a parallel environment. It is important to note though: If you use this feature, you must ensure that your CI solution calls the parallel webhook when everything is done. Moreover, regardless of what CI you use, you have to make sure that the build_number is constant across the different jobs, otherwise coveralls is unable to group them together as one build.

See https://docs.coveralls.io/parallel-build-webhook

SEE ALSO

https://coveralls.io/ https://coveralls.io/docs https://github.com/coagulant/coveralls-python Devel::Cover

EXAMPLE

https://coveralls.io/r/kan/p5-smart-options

LICENSE

Copyright (C) Kan Fushihara

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Kan Fushihara [email protected]

coveralls-perl's People

Contributors

kan avatar bayashi avatar mohawk2 avatar sirtoobii avatar voegelas avatar songmu avatar jacquesg avatar jraspass avatar dsteinbrunner avatar haarg avatar chylli-deriv avatar

Stargazers

 avatar Olaf Alders avatar Johann Rolschewski avatar haruna avatar Alexandr Evstigneev avatar hitode909 avatar Thibault Duponchelle avatar Roy Ivy III avatar Christian Leutloff avatar Andrew Hewus Fresh avatar Angus H. avatar Pine Mizune avatar Leon Wright avatar Breno G. de Oliveira avatar Axel Beckert avatar Sergiy Borodych avatar Zaki Mughal [sivoais] avatar Helmut Wollmersdorfer avatar Satoshi Azuma a.k.a. ytnobody avatar Victor Efimov avatar  avatar Naoya Ito avatar Eric Gallager avatar Tatsuhiko Miyagawa avatar

Watchers

 avatar James Cloos avatar Leon Wright avatar  avatar

coveralls-perl's Issues

Test failed on travis.

See https://travis-ci.org/tokuhirom/Minilla/jobs/6950859

t/01_basic.t .... 1/?     
    #   Failed test 'config'
    #   at t/01_basic.t line 30.
    #     Structures begin differing at:
    #          $got->{service_name} = 'travis-ci'
    #     $expected->{service_name} = 'coveralls-perl'
    # Looks like you failed 1 test of 1.
#   Failed test 'get_config local'
#   at t/01_basic.t line 31.
# Looks like you failed 1 test of 3.
t/01_basic.t .... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests 

fixed image url in POD

外部サービスじゃなくgithubに置いてgithub.ioなURLで参照する。
0.04リリース時にやろう

POD: Add links to report example

It would be helpful to add links to some example reports for Perl projects. That would help the user to quickly see the benefit it can get from enabling coveralls.io on his/her project.

uncoverable statements

Devel::Cover supports comments to mark particular statements as uncoverable:

if ($x == 0) {
   return 0;
}
elsif ($x > 0) {
   return 1;
}
elsif ($x < 0) {
   return -1;
}
else {
   die("huh?); # uncoverable statement
}

Devel::Cover::Statement exposes this information via a method called uncoverable.

Would it be possible for Devel::Cover::Report::Coveralls to pass this information to coveralls.io? (According to the API reference, setting he coverage information for that line to null ought to do it.)

Incorrect metadata

The mertadata for repository and issue tracker are wrong. They should be https not ssh. This is breaking the links on the CPAN::Meta page

test will fail on CircleCI

When run test on CircelCI.com, it will fail:

    #   Failed test 'config service_name'
    #   at t/01_basic.t line 45.
    #          got: 'circleci'
    #     expected: 'github-actions'

    #   Failed test 'config service_number'
    #   at t/01_basic.t line 46.
    #          got: '12387'
    #     expected: '123456789'
    # Looks like you failed 2 tests of 3.

#   Failed test 'get_config github'
#   at t/01_basic.t line 48.
    # No tests run!

#   Failed test 'No tests run for subtest "get_config github actions improved"'
#   at t/01_basic.t line 58.
required repo_token in .coveralls.yml, or launch via Travis at /home/git/.cpanm/work/1640820299.64935/Devel-Cover-Report-Coveralls-0.20/blib/lib/Devel/Cover/Report/Coveralls.pm line 131.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 255 just after 4.

Report branch coverage results to coveralls

According to this comment coveralls added support for branch coverage metrics on top of line coverage.

Since Devel::Cover also measures branch coverage, it would be nice to allow this module to share that information with coveralls as well.

I might be able to send a pull request about that, but as of this moment I'm not familiar with the coveralls API, nor with this module's internals. Any further guidance would be appreciated. If someone else beats me to it, I can use that for learning purposes, so I'm fine with that too :)

Use of newer webhook API by GitHub Actions

This module uses the v1 API that needs the repo token configured by some means, as shown in #33. However, looking at https://github.com/coverallsapp/github-action/blob/master/src/run.ts#L51 it appears that there is another way for GH actions: to use Coveralls's webhook endpoint, which uses as its repo_token the GITHUB_TOKEN that, crucially, is already available. Are you open to a PR adding this capability, probably dispatched on a GITHUB_TOKEN env var?

This would mean eserte/graphviz-makefile#4 and graphviz-perl/Graph#16 wouldn't be needed (at least to get Coveralls working).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.