Skip to content

Commit

Permalink
[qacode] add ci, codeclimate, #164 (#165)
Browse files Browse the repository at this point in the history
* [qacode] add ci, codeclimate, #164

* [qacode] fix parse error

* [qacode] missing activate env before install

* [qacode] activate env at after_test step

* [qacode] try to missing not found report file

* [qacode] CI codeclimate, more path changes trying to fix this ...

* [qacode] another try

* [qacode] fix ci imcopatible versions

- error here:
 https://circleci.com/gh/netzulo/qacode/15

* [qacode] missing package... manual install

* [qacode] loving codeclimate

* [qacode] finixshing ci codeclimate+circleci
  • Loading branch information
netzulo authored Jun 10, 2018
1 parent c4efb39 commit a97028a
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 181 deletions.
36 changes: 30 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,53 @@
version: 2
jobs:
build:
environment:
CC_TEST_REPORTER_ID: 181a274c2c68483ff80af63a8a87e1f5fab71f37744eab702f25695501b5ca85
docker:
- image: circleci/python:3.6.1

working_directory: ~/repo

steps:
- checkout

- run:
name: install dependencies
name: Install dependencies
command: |
# CI, CircleCI dependencies
python3 -m venv venv
. venv/bin/activate
python setup.py install
# CI, codeclimate dependencies
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
pip install codeclimate-test-reporter
# project dependencies
pip install tox
pip install coverage==4.2
- run:
name: Install project
command: |
. venv/bin/activate
python setup.py install
- run:
name: Before Tests
command: |
./cc-test-reporter before-build
- run:
name: Run Tests
command: |
. venv/bin/activate
tox -e coverage,flake8,docs
- run:
name: run tests
name: After Tests
command: |
. venv/bin/activate
tox -e py36,flake8,docs
ls -ltra tests/reports/
codeclimate-test-reporter --token $CC_TEST_REPORTER_ID --file .coverage
- store_artifacts:
path: dist
destination: dist

8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,9 @@ ENV/

# QACODE ignores
qacode/configs/settings.json
tests/reports/report_xunit.xml
tests/reports/report_html.html
tests/reports/report_coverage.xml
tests/reports/report_coverage_html/*
tests/reports/report_benchmark/benchmarks.*.svg
tests/reports/*
tests/reports/coverage/*
tests/reports/benchmarks/benchmark.*.svg
# Visual Studio
.vs/
# Visual code
Expand Down
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ QA Code
:alt: Release date on Github
:target: https://github.com/netzulo/qacode/releases/latest

+-----------------------+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+
| Branch | Linux Deploy | Windows Deploy | CircleCI - Docker |
+=======================+===================================================================+================================================================================================+===========================================================================================================================+
| master | .. image:: https://travis-ci.org/netzulo/qacode.svg?branch=master | .. image:: https://ci.appveyor.com/api/projects/status/4a0tc5pis1bykt9x/branch/master?svg=true | .. image:: https://circleci.com/gh/netzulo/qacode.svg?&style=shield&circle-token=80384cb2233d112dc0785278d5b7c3d8c6a5686c |
+-----------------------+-----------------------+-------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+
+-----------------------+-------------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| Branch | Linux Deploy | Windows Deploy | CircleCI - Docker | CodeClimate |
+=======================+===================================================================+================================================================================================+===========================================================================================================================+========================================================================================+
| master | .. image:: https://travis-ci.org/netzulo/qacode.svg?branch=master | .. image:: https://ci.appveyor.com/api/projects/status/4a0tc5pis1bykt9x/branch/master?svg=true | .. image:: https://circleci.com/gh/netzulo/qacode.svg?&style=shield&circle-token=80384cb2233d112dc0785278d5b7c3d8c6a5686c | .. image:: https://api.codeclimate.com/v1/badges/46279cf9a6a47ed583d6/maintainability |
+-----------------------+-----------------------+-------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+


Python tested versions
Expand Down
10 changes: 5 additions & 5 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[pytest]
addopts =
--verbose
--junit-xml=tests/reports/report_xunit.xml
--html=tests/reports/report_html.html
--junit-xml=tests/reports/test_coverage.xml
--html=tests/reports/test_coverage.html
--self-contained-html
--cov=qacode tests/
--cov-report html:tests/reports/report_coverage_html/
--cov-report xml:tests/reports/report_coverage.xml
--benchmark-histogram=tests/reports/report_benchmark/benchmarks.svg
--cov-report html:tests/reports/coverage/
--cov-report xml:tests/reports/coverage.xml
--benchmark-histogram=tests/reports/benchmarks/benchmark.svg
testpaths = tests
console_output_style = progress
python_files = suite_*_*.py
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ def read(file_name=None, is_encoding=True, ignore_raises=False):
tests_require=[
'pytest-html',
'pytest-dependency',
'pytest-cov',
'coverage==4.3.4',
'pytest-cov==2.5.0',
'pytest-benchmark',
'pytest-benchmark[histogram]'
],
Expand Down
157 changes: 0 additions & 157 deletions tests/reports/assets/style.css

This file was deleted.

8 changes: 6 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@ exclude =
[testenv:coverage]
description = Environment to generate coverage reports
commands =
pytest --self-contained-html --cov=qacode tests/ --cov-report html:tests/reports/report_coverage_html/ --cov-report xml:tests/reports/report_coverage.xml
py.test --self-contained-html --cov=qacode tests/ --cov-report html:tests/reports/coverage/ --cov-report xml:tests/reports/coverage.xml
deps =
pytest
pytest-cov
pytest-html
pytest-dependency
coverage==4.3.4
pytest-cov==2.5.0
pytest-benchmark
pytest-benchmark[histogram]

exclude =
.git,
__pycache__,
Expand Down

0 comments on commit a97028a

Please sign in to comment.