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

(Chore) App 3.0 - Collect both app and API coverage #313

Merged
merged 2 commits into from
Aug 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,23 @@ before_install:

install:
- source scripts/install-${TRAVIS_OS_NAME} # OS-specific installs
- pip install pyyaml coveralls
- make -C api install
- make -C app install
- make install

script:
- "export OT_TIME_SUFFIX=-$(date '+%Y-%m-%d_%H-%M')"
- "export OT_BRANCH_SUFFIX=-${TRAVIS_BRANCH}"
- "export OT_COMMIT_SUFFIX=-${TRAVIS_COMMIT:0:7}"
# TODO(mc, 2018-08-28): use top level `make test`
- make -C api test exe
- > # Make docs on linux only
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then (make -C api docs > /dev/null) fi;
# TODO(mc, 2018-08-28): use top level `make test`
- make -C app -j 2 build test && make -C app package
# Clean up. This will leave only single-file build artifacts
- find ./app/dist/** ! -name 'opentrons-v*' -exec rm -rf {} +

after_success:
- cd api && coveralls && cd ..
- make coverage

# Deploy the build version in an S3 bucket
deploy:
Expand All @@ -78,7 +78,7 @@ deploy:
# Publish API to PyPI and Anaconda
- provider: script
skip_cleanup: true
script: cd api && make publish && cd ..
script: make -C api publish
on:
tags: true

Expand Down
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# opentrons platform makefile
# https://github.com/OpenTrons/opentrons

SHELL := /bin/bash

API_DIR := api
APP_DIR := app

.PHONY: install test coverage

# install project dependencies for both api and app
install:
$(MAKE) -C $(API_DIR) install
$(MAKE) -C $(APP_DIR) install

# run api and app tests
test:
$(MAKE) -C $(API_DIR) test
$(MAKE) -C $(APP_DIR) test

# upload coverage reports
# uses codecov's bash upload script
# TODO(mc, 2018-08-28): add test as a task dependency once travis is setup to
# use this Makefile for tests
coverage:
$(SHELL) <(curl -s https://codecov.io/bash) -X coveragepy
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Opentrons Platform

[![Travis CI][travis-badge]][travis]
[![Codecov][codecov-badge]][codecov]

* [Overview](#overview)
* [Opentrons API](#api)
* [OT-App](#app)
Expand Down Expand Up @@ -134,3 +137,8 @@ make dev
```

Enjoy!

[travis]: https://travis-ci.org/OpenTrons/opentrons/branches
[travis-badge]: https://img.shields.io/travis/OpenTrons/opentrons/app-3-0.svg?style=flat-square&maxAge=3600
[codecov]: https://codecov.io/gh/OpenTrons/opentrons/branches
[codecov-badge]: https://img.shields.io/codecov/c/github/OpenTrons/opentrons/app-3-0.svg?style=flat-square&maxAge=3600
4 changes: 2 additions & 2 deletions api/.coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ omit =
*/lib_pypy/_*.py
*/site-packages/ordereddict.py
*/site-packages/nose/*
*/unittest2/*
opentrons/_version.py
*/tests/*
opentrons/_version.py
6 changes: 4 additions & 2 deletions api/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
SHELL:=/bin/bash
# opentrons api makefile

SHELL := /bin/bash

.PHONY: test docs publish clean install exe dev

install:
python setup.py install && pip install -r requirements.txt

test:
pylama opentrons tests && py.test --cov
pylama opentrons tests && py.test --cov && coverage xml

docs:
cd docs && make html && make doctest
Expand Down
2 changes: 1 addition & 1 deletion app/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# app makefile
# opentrons app makefile

# use bash
SHELL := /bin/bash
Expand Down
3 changes: 3 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@
"!webpack**",
"!coverage/**",
"!**/test/**"
],
"coverageReporters": [
"lcov", "text"
]
},
"standard": {
Expand Down