@@ -35,11 +35,11 @@ before_install:
35
35
- sudo /opt/puppetlabs/bin/puppet -V
36
36
37
37
# # install packages for linting
38
- #
39
- # @trusty-backports, allows additional packages (i.e. shellcheck) to be installed
40
- #
41
- # Note: unit testing is performed within the docker container, which is
42
- # defined from the Dockerfile.
38
+ # #
39
+ # # @trusty-backports, allows additional packages (i.e. shellcheck) to be installed
40
+ # #
41
+ # # Note: unit testing is performed within the docker container, which is
42
+ # # defined from the Dockerfile.
43
43
install :
44
44
- sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty-backports restricted main universe"
45
45
- pip install flake8==2.5.4
@@ -60,21 +60,22 @@ install:
60
60
- gem install yaml-lint -v 0.0.7
61
61
- npm install -g dockerlint@0.2.0
62
62
- pip install restructuredtext_lint==0.17.2
63
+ - pip install python-coveralls==2.9.0
63
64
64
65
# # implement linting / unit tests
65
- #
66
- # @puppet-lint, the following issue needs to be checked if it has been
67
- # resolved, so the '--no-ensure_first_param-check' abusive flag
68
- # implementation (below) can be removed:
69
- #
70
- # - https://github.com/rodjek/puppet-lint/issues/410
71
- #
72
- # @docker run:
73
- # -d, run container in background and print container ID
74
- # -t, allocate pseudo-tty instead of default tty to running container
75
- #
76
- # Note: unit testing is performed within the docker container, which is
77
- # defined from the Dockerfile.
66
+ # #
67
+ # # @puppet-lint, the following issue needs to be checked if it has been
68
+ # # resolved, so the '--no-ensure_first_param-check' abusive flag
69
+ # # implementation (below) can be removed:
70
+ # #
71
+ # # - https://github.com/rodjek/puppet-lint/issues/410
72
+ # #
73
+ # # @docker run:
74
+ # # -d, run container in background and print container ID
75
+ # # -t, allocate pseudo-tty instead of default tty to running container
76
+ # #
77
+ # # Note: unit testing is performed within the docker container, which is
78
+ # # defined from the Dockerfile.
78
79
script :
79
80
# lint codebase
80
81
- flake8 .
@@ -113,10 +114,28 @@ script:
113
114
- cat pytest.log
114
115
- (! grep -qE '= FAILURES =|= ERRORS =|= no tests ran in 0.00 seconds =' pytest.log)
115
116
117
+ # # acquire coverage results
118
+ # #
119
+ # # Note: more information regarding the '.coverage.docker' naming convention:
120
+ # #
121
+ # # https://github.com/pytest-dev/pytest-cov/issues/146#issuecomment-272971136
122
+ # #
123
+ - docker cp webserver-pytest:/var/machine-learning/.coverage .coverage.docker
124
+
116
125
# check exit code: 'docker exec' will fail if the container has an exit code
117
126
- docker exec -it webserver echo "'docker exec' only works on an active running container"
118
127
- docker exec -it database echo "'docker exec' only works on an active running container"
119
128
- docker exec -it redis echo "'docker exec' only works on an active running container"
120
129
121
130
# list all containers
122
131
- docker ps -a
132
+
133
+ # # post build: the following commands are run after a successful build.
134
+ # #
135
+ # # Note: more information regarding the coverage-coverall implementation:
136
+ # #
137
+ # # https://github.com/pytest-dev/pytest-cov/issues/146
138
+ # #
139
+ after_success :
140
+ - coverage combine
141
+ - coveralls
0 commit comments