Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Initial Implementation #1

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

Merged
merged 2 commits into from
Apr 18, 2016
Merged

Initial Implementation #1

merged 2 commits into from
Apr 18, 2016

Conversation

dblandin
Copy link
Contributor

@dblandin dblandin commented Apr 13, 2016

This PR contains the initial implementation for our python test reporter. The reporter supports Coverage.py, which is a popular Python tool for measuring code coverage. This project has been influenced by the interface of two coveralls reporters which read the a Coverage.py coverage file from the default location of ./.coverage.

Coverage.py has a few reporters available. The one that I thought made most sense to use was the XML reporter, so the package is currently generating that report to then read and parse while generating a JSON payload for our API.

@codeclimate/review 🔎

Project structure

├── reporter
│   ├── __main__.py # <- package entry point
│   ├── components # <- package components
│   └── tests # <- package tests
│       ├── fixtures
├── setup.py # <- package definition

CLI

$ codeclimate-test-reporter --help
usage: codeclimate-test-reporter [-h] [--file FILE] [--token TOKEN] [--stdout]
                                 [--debug] [--version]

Report test coverage to Code Climate

optional arguments:
  -h, --help     show this help message and exit
  --file FILE    A coverage.py coverage file to report
  --token TOKEN  Code Climate repo token
  --stdout       Output to STDOUT
  --debug        Enable debug mode
  --version      Show the version

Todo

  • Intake coverage.py coverage file
  • Format JSON payload
  • Submit to CC API
  • Extract VCS info from various CI services
  • Validate payload
  • Error handling on validation and API response

$(IMAGE_NAME) -c 'python setup.py test && codeclimate-test-reporter'

image:
docker build --rm -t $(IMAGE_NAME) .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: --rm is the default on 1.9+, I think. I don't think we've been putting it on newer repos.

@dblandin dblandin force-pushed the devon/add-project-structure branch 9 times, most recently from 5cd249a to edcf3af Compare April 18, 2016 15:01
@dblandin
Copy link
Contributor Author

@codeclimate/review This is ready for another 🔎 !

@dblandin dblandin changed the title [wip] Initial Implementation Initial Implementation Apr 18, 2016

__author__ = "Code Climate"
__version__ = open(os.path.join(os.path.dirname(__file__), "VERSION")).read().strip()
__licence__ = "MIT"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in this line

@gdiggs
Copy link

gdiggs commented Apr 18, 2016

Seems cool to me! If it works for you locally I say :shipit:

 - Dockerfile for development/testing
 - requirements.txt file for dependencies
 - reporter/main.py entrypoint
 - debug flag for library/python/platform versions
 - Use pytest for tests
@dblandin dblandin force-pushed the devon/add-project-structure branch from edcf3af to 6b50b02 Compare April 18, 2016 17:33
@dblandin
Copy link
Contributor Author

Seems cool to me! If it works for you locally I say :shipit:

Sounds good! I'll work on the docs in a separate PR.

@dblandin dblandin merged commit ca4aa0b into master Apr 18, 2016
@dblandin dblandin deleted the devon/add-project-structure branch April 18, 2016 18:23
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

Successfully merging this pull request may close these issues.

3 participants