Skip to content

Commit 6b8a90d

Browse files
Add dedicated coverage tox env
1 parent 9168e9a commit 6b8a90d

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

buildspec.yml

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ batch:
1313
buildspec: codebuild/python3.7.yml
1414
- identifier: python3_8
1515
buildspec: codebuild/python3.8.yml
16+
17+
- identifier: code_coverage
18+
buildspec: codebuild/coverage/coverage.yml

codebuild/coverage/coverage.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
TOXENV: "coverage"
6+
7+
phases:
8+
install:
9+
runtime-versions:
10+
python: latest
11+
build:
12+
commands:
13+
- pip install tox
14+
- tox

tox.ini

+9-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ envlist =
3535
# test-release :: Builds dist files and uploads to testpypi pypirc profile.
3636
# release :: Builds dist files and uploads to pypi pypirc profile.
3737

38+
# Reporting environments:
39+
#
40+
# coverage :: Runs code coverage, failing the build if coverage is below the configured threshold
41+
3842
[testenv:base-command]
39-
commands = pytest --basetemp={envtmpdir} -l --cov dynamodb_encryption_sdk {posargs}
43+
commands = pytest --basetemp={envtmpdir} -l {posargs}
4044

4145
[testenv]
4246
passenv =
@@ -58,7 +62,6 @@ deps = -rtest/requirements.txt
5862
download = true
5963
commands =
6064
# Only run small test scenario sets
61-
local-fast: {[testenv:base-command]commands} test/ -m "local and not slow and not veryslow and not nope"
6265
integ-fast: {[testenv:base-command]commands} test/ -m "integ and not ddb_integ and not slow and not veryslow and not nope"
6366
ddb-fast: {[testenv:base-command]commands} test/ -m "ddb_integ and not slow and not veryslow and not nope"
6467
all-fast: {[testenv:base-command]commands} test/ -m "not slow and not veryslow and not nope"
@@ -86,6 +89,10 @@ commands =
8689
# Only run examples tests
8790
examples: {[testenv:base-command]commands} examples/test/ -m "examples"
8891

92+
# Run code coverage on the unit tests
93+
[testenv:coverage]
94+
commands = {[testenv:base-command]commands} --cov dynamodb_encryption_sdk test/ -m "local and not slow and not veryslow and not nope"
95+
8996
# Verify that local tests work without environment variables present
9097
[testenv:nocmk]
9198
basepython = python3

0 commit comments

Comments
 (0)