Giter Site home page Giter Site logo

test-coverage-action's Introduction

DeepSource Test Coverage Action

DeepSource

GitHub Action that enables you to upload your test coverage data to DeepSource easily. You must have the Test Coverage analyzer enabled on your repository for reporting to work. Please refer to the .deepsource.toml configuration reference for details.

If you're not using DeepSource yet, get started for free.

Usage

This Action assumes that the coverage file has already been generated after the tests have run. To integrate it in your workflow, define a step which refers to this Action in your workflow.yml file. We recommend that you use @master as the ref.

Ensure that you have added the DEEPSOURCE_DSN secret in your GitHub repository. It is available under Settings → Reporting tab of the repository page on DeepSource.

steps:
  - name: Report test coverage to DeepSource
    uses: deepsourcelabs/test-coverage-action@master
    with:
      key: python
      coverage-file: coverage.xml
      dsn: ${{ secrets.DEEPSOURCE_DSN }}

The possible inputs to this action are:

  • key (string, required): Programming language shortcode for which coverage is reported. e.g. python, go, javascript. See the docs for the current list of allowed values.
  • coverage-file (string, required): Path to the coverage data file. e. g. coverage.xml
  • dsn (string, required): DeepSource DSN of this repository.
  • fail-ci-on-error (boolean): Should the CI build fail if there is an error while uploading the report to DeepSource? Allowed values are: true, false. This is set to false by default.

License

This project is released under the MIT License.

test-coverage-action's People

Contributors

akshit-deepsource avatar deepsource-autofix[bot] avatar jayvdb avatar sanket-deepsource avatar shruddha-deepsource avatar souvik-deepsource avatar srijan-deepsource avatar tushar-deepsource avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

test-coverage-action's Issues

Add support for Windows and MacOS.

The test coverage action doesn't work on Windows and MacOS.

Since we're planning to run tests on Windows and MacOS for the DeepSource CLI, I think it would be a helpful feature!

Using the action under Windows/MacOS runner OS environments throws an error like this:

deepsourcelabs/test-coverage-action@master action is only supported on Linux

Fails with: Error: exit status 128

No other log provided.

We've seen this for many months, and switched to fetching the CLI and using that, but I tried the github action again today and the problem still exists.

Post output from CLI

After uploading the artifact, CLI post some output whether successful or any error, It would be nice to show the same.

Action always fails

Traceback (most recent call last):
  File "/app/main.py", line 62, in <module>
    main()
  File "/app/main.py", line 58, in main
​
    print(process.err.decode("utf-8"), file=sys.stderr)
AttributeError: 'CompletedProcess' object has no attribute 'err'

8b49725#diff-b10564ab7d2c520cdd0243874879fb0a782862c3c902ab535faabe57d5a505e1R58 is the culprit.

I strongly suggest you use mypy/pyright in the future to avoid such relatively easily preventable breakages, also consider adding tests.

Coverage complaining about lines outside the PR delta

First of all, I apologize if this is the wrong place to post this bug report. I do not have permissions to create a new topic in discuss.

My issue is that when we have a PR that touches a file with existing coverage issues, all of these issues are surfaced in a given PR rather than only the issues introduced or resolved by the pull request line delta. The analysis scope is set to "granular", yet existing coverage issues service anyway on lines not affected by a given pull request.

Screenshot from 2020-10-09 16-34-26

For a specific example, this pull request prysmaticlabs/prysm#7488 was rather small in scope and only reduced a few redundant error checks. However, the coverage reporting says this pull request introduces two new coverage issues which are completely unrelated.

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.