1
0
Fork 0

[DEV-6721] Add optional code coverage

master
Austin Schaffer 2020-01-31 14:12:52 -05:00
parent 3c5cffc34f
commit e81516ca80
4 changed files with 22 additions and 5 deletions

View File

@ -3,12 +3,13 @@ image: $BUILD_IMAGE
stages: stages:
- build - build
- deploy - deploy
- publish
build: build:
stage: build stage: build
script: script:
- autoreconf -fvi - autoreconf -fvi
- ./configure --with-srcuri="$SRCURI" - ./configure --with-srcuri="$SRCURI" --enable-code-coverage
- npm install - npm install
- make all - make all
- make info pdf html - make info pdf html
@ -16,6 +17,7 @@ build:
artifacts: artifacts:
paths: paths:
- doc/ - doc/
- coverage/
expire_in: 30 min expire_in: 30 min
pages: pages:
@ -23,9 +25,11 @@ pages:
script: script:
- mkdir -p public/doc - mkdir -p public/doc
- mv doc/liza.html/* doc/liza.pdf doc/liza.info public/ - mv doc/liza.html/* doc/liza.pdf doc/liza.info public/
- mkdir -p public/coverage
- mv coverage/* public/coverage
artifacts: artifacts:
paths: paths:
- public/ - public/
expire_in: 30 min expire_in: 30 min
only: only:
- tags - tags

View File

@ -67,10 +67,11 @@ check-ts-out:
test: check test: check
check: $(tsout) check-ts-out check: $(tsout) check-ts-out
PATH="$(PATH):$(CURDIR)/node_modules/mocha/bin" \ PATH="$(PATH):$(CURDIR)/node_modules/.bin" \
mocha @NODE_DESTRUCTURE@ \ @CODE_COV@ mocha @NODE_DESTRUCTURE@ \
--require $(path_test)/pre.js \ --require $(path_test)/pre.js \
--recursive \ --recursive \
@COV_ARGS@ \
$(TESTARGS) $(TESTARGS)
FORCE: FORCE:

View File

@ -79,6 +79,16 @@ AC_ARG_WITH(
AC_SUBST([SET_SRCURI], [$set_srcuri]) AC_SUBST([SET_SRCURI], [$set_srcuri])
AC_ARG_ENABLE(
[code_coverage],
[AS_HELP_STRING([--enable-code-coverage],
[Generate a code coverage report when tests are run
(disabled by default)])],
AC_SUBST([CODE_COV], ["nyc --reporter=html --reporter=text --all --include=src \
--exclude=**/index.js --exclude=src/version.js"])
AC_SUBST([COV_ARGS], ["--require ts-node/register/transpile-only \
--require source-map-support/register"]))
AC_SUBST([AUTOGENERATED], AC_SUBST([AUTOGENERATED],
["THIS FILE IS AUTOGENERATED! DO NOT MODIFY! See *.in."]) ["THIS FILE IS AUTOGENERATED! DO NOT MODIFY! See *.in."])

View File

@ -43,7 +43,9 @@
"@types/mocha": "5.2.0", "@types/mocha": "5.2.0",
"sinon": ">=1.17.4", "sinon": ">=1.17.4",
"es6-promise": "~3", "es6-promise": "~3",
"@types/amqplib": "0.5.13" "@types/amqplib": "0.5.13",
"nyc": "15.0.0",
"ts-node": "^8.6.2"
}, },
"licenses": [ "licenses": [