diff --git a/Makefile b/Makefile index d89613c6..aa37c814 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,11 @@ COCKPIT_REPO_STAMP=pkg/lib/cockpit-po-plugin.js # common arguments for tar, mostly to make the generated tarballs reproducible TAR_ARGS = --sort=name --mtime "@$(shell git show --no-patch --format='%at')" --mode=go=rX,u+rw,a-s --numeric-owner --owner=0 --group=0 +ifeq ($(TEST_COVERAGE),yes) +RUN_TESTS_OPTIONS+=--coverage +NODE_ENV=development +endif + all: $(DIST_TEST) # checkout common files from Cockpit repository required to build this project; @@ -100,11 +105,11 @@ print-version: dist: $(TARFILE) @ls -1 $(TARFILE) -# when building a distribution tarball, call bundler with a 'production' environment +# when building a distribution tarball, call bundler with a 'production' environment by default # we don't ship node_modules for license and compactness reasons; we ship a # pre-built dist/ (so it's not necessary) and ship package-lock.json (so that # node_modules/ can be reconstructed if necessary) -$(TARFILE): export NODE_ENV=production +$(TARFILE): export NODE_ENV ?= production $(TARFILE): $(DIST_TEST) $(SPEC) tar --xz $(TAR_ARGS) -cf $(TARFILE) --transform 's,^,$(RPM_NAME)/,' \ --exclude $(SPEC).in --exclude node_modules --exclude test/reference \ diff --git a/test/run b/test/run index 8940c0d0..306c28a0 100755 --- a/test/run +++ b/test/run @@ -8,6 +8,12 @@ TEST_SCENARIO="${TEST_SCENARIO:-}" [ "${TEST_SCENARIO}" = "${TEST_SCENARIO##firefox}" ] || export TEST_BROWSER=firefox export RUN_TESTS_OPTIONS=--track-naughties +TEST_SCENARIO=${TEST_SCENARIO:-} + +if [ "$TEST_SCENARIO" = "devel" ]; then + export TEST_COVERAGE=yes +fi + # linters are off by default for production builds, but we want to run them in CI export LINT=1