From 565ad7f3811d2d7b51428fed9ae65bda2ff94971 Mon Sep 17 00:00:00 2001 From: Simon Brewster Date: Tue, 5 Sep 2017 11:40:27 +0200 Subject: [PATCH 1/2] test: Clean up package-lock.json after coverage When running make coverage npm installs istanbul-merge and nyc and generates a package-lock.json file Ensure this file is removed when running make coverage-clean Refs: https://github.com/nodejs/node/pull/15190/files#r136932786 --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 67a568cfa54efe..5aeddd450cb93f 100644 --- a/Makefile +++ b/Makefile @@ -120,6 +120,7 @@ check: test # in place coverage-clean: if [ -d lib_ ]; then $(RM) -r lib; mv lib_ lib; fi + $(RM) package-lock.json $(RM) -r node_modules $(RM) -r gcovr testing $(RM) -r out/$(BUILDTYPE)/.coverage From 39846c12661cbc28739aaadd9edbc2b68c99dd57 Mon Sep 17 00:00:00 2001 From: Simon Brewster Date: Wed, 6 Sep 2017 09:12:20 +0200 Subject: [PATCH 2/2] test: use no-save and no-package-lock flags Use these flags when running make coverage so that a package-lock.json file is not generated and npm does not attempt to save the deps to a non-existent package.json file Refs: https://github.com/nodejs/node/pull/15190/files#r136932786 --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5aeddd450cb93f..c0b7daefdc9751 100644 --- a/Makefile +++ b/Makefile @@ -120,7 +120,6 @@ check: test # in place coverage-clean: if [ -d lib_ ]; then $(RM) -r lib; mv lib_ lib; fi - $(RM) package-lock.json $(RM) -r node_modules $(RM) -r gcovr testing $(RM) -r out/$(BUILDTYPE)/.coverage @@ -140,8 +139,9 @@ coverage: coverage-test coverage-build: all mkdir -p node_modules if [ ! -d node_modules/istanbul-merge ]; then \ - $(NODE) ./deps/npm install istanbul-merge; fi - if [ ! -d node_modules/nyc ]; then $(NODE) ./deps/npm install nyc; fi + $(NODE) ./deps/npm install istanbul-merge --no-save --no-package-lock; fi + if [ ! -d node_modules/nyc ]; then \ + $(NODE) ./deps/npm install nyc --no-save --no-package-lock; fi if [ ! -d gcovr ]; then git clone --depth=1 \ --single-branch git://github.com/gcovr/gcovr.git; fi if [ ! -d testing ]; then git clone --depth=1 \