Skip to content

Commit 77109de

Browse files
committed
Consolidate tests to single run and add coverage
1 parent ea75a99 commit 77109de

File tree

4 files changed

+43
-21
lines changed

4 files changed

+43
-21
lines changed

.appveyor.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ install:
5555
# Install Python packages
5656
- cmd: "%PIP3% install https://www.dropbox.com/s/7wfgus1op7ga9ni/py2exe-0.9.2.2-cp34-none-win32.whl?raw=1"
5757
- cmd: "%PIP3% install mkdocs"
58+
- cmd: "%PIP3% install coverage"
59+
- cmd: "%PIP% install coverage"
5860
- cmd: "%PIP% install mock"
5961
- cmd: "%PIP% freeze"
6062
- cmd: "%PIP3% freeze"
@@ -75,12 +77,10 @@ build: off
7577
test_script:
7678
- cmd: chcp 65001
7779
- cmd: set PYTHONIOENCODING=utf-8
78-
- cmd: "%PYTHON%\\python ardublocklyserver\\tests\\sketchcreator_test.py"
79-
- cmd: "%PYTHON3%\\python ardublocklyserver\\tests\\sketchcreator_test.py"
80-
- cmd: "%PYTHON%\\python ardublocklyserver\\tests\\compilersettings_test.py"
81-
- cmd: "%PYTHON3%\\python ardublocklyserver\\tests\\compilersettings_test.py"
82-
- cmd: "%PYTHON%\\python ardublocklyserver\\tests\\actions_test.py"
83-
- cmd: "%PYTHON3%\\python ardublocklyserver\\tests\\actions_test.py"
80+
- cmd: "%PYTHON%\\python -m coverage run ardublocklyserver\\tests\\run_all.py"
81+
- cmd: "%PYTHON%\\python -m coverage report"
82+
- cmd: "%PYTHON3%\\python -m coverage run ardublocklyserver\\tests\\run_all.py"
83+
- cmd: "%PYTHON3%\\python -m coverage report"
8484

8585
# Push artefact to S3 bucket and list all
8686
before_deploy:

.travis.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ before_install:
3535

3636
# Install Python packages (built with Python 3, tests for 2 and 3)
3737
- sudo python -m pip install mock
38+
- sudo python -m pip install coverage
39+
- pip3 install coverage
40+
- pip3 install coveralls
3841
- pip3 install mkdocs
3942
- pip3 install pyinstaller
4043

@@ -70,12 +73,13 @@ install:
7073

7174
# Run the tests in both Python 2 and 3
7275
script:
73-
- python ardublocklyserver/tests/sketchcreator_test.py
74-
- python3 ardublocklyserver/tests/sketchcreator_test.py
75-
- python ardublocklyserver/tests/compilersettings_test.py
76-
- python3 ardublocklyserver/tests/compilersettings_test.py
77-
- python ardublocklyserver/tests/actions_test.py
78-
- python3 ardublocklyserver/tests/actions_test.py
76+
- python -m coverage run ardublocklyserver/tests/run_all.py
77+
- python -m coverage report
78+
- python3 -m coverage run ardublocklyserver/tests/run_all.py
79+
- python3 -m coverage report
80+
81+
after_success:
82+
- coveralls
7983

8084
# Deploy the build version in an S3 bucket
8185
deploy:

ardublocklyserver/tests/run_all.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Runs all the unit tests from this directory.
4+
#
5+
# This file manually adds the tests to be run.
6+
#
7+
# Copyright (c) 2017 carlosperate https://github.com/carlosperate/
8+
# Licensed under the Apache License, Version 2.0 (the "License"):
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
import unittest
12+
13+
from sketchcreator_test import SketchCreatorTestCase
14+
from compilersettings_test import ServerCompilerSettingsTestCase
15+
from actions_test import ActionsTestCase
16+
17+
18+
if __name__ == '__main__':
19+
unittest.main()

circle.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ dependencies:
4444
# The GLIBC version might have been updated with apt-get installs
4545
- ldd --version
4646

47-
# Python packages (built on Python 2, tests run both 2 and 3)
48-
- sudo pip2 install mock
49-
- sudo pip2 install
47+
# Python packages (built on Python 3, tests run both 2 and 3)
5048
- sudo pip2 install awscli
49+
- sudo pip2 install mock
50+
- sudo pip2 install coverage
51+
- sudo pip3 install coverage
5152
- sudo pip3 install mkdocs
5253
- sudo pip3 install pyinstaller
5354
- pyinstaller --version
@@ -74,12 +75,10 @@ dependencies:
7475
# Customize test commands
7576
test:
7677
override:
77-
- python ardublocklyserver/tests/sketchcreator_test.py
78-
- python3 ardublocklyserver/tests/sketchcreator_test.py
79-
- python ardublocklyserver/tests/compilersettings_test.py
80-
- python3 ardublocklyserver/tests/compilersettings_test.py
81-
- python ardublocklyserver/tests/actions_test.py
82-
- python3 ardublocklyserver/tests/actions_test.py
78+
- python -m coverage run ardublocklyserver/tests/run_all.py
79+
- python -m coverage report
80+
- python3 -m coverage run ardublocklyserver/tests/run_all.py
81+
- python3 -m coverage report
8382

8483
general:
8584
artifacts:

0 commit comments

Comments
 (0)