From 81f566b44a76a25d1816957ef8fcc8a271eadcef Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Wed, 20 Oct 2021 11:48:19 +0200 Subject: [PATCH] Added codecov.io coverage uploader to CI refs linear.app/tryghost/issue/CORE-74/improve-the-test-situation - this commit adds the codecov GitHub Action into CI so we can upload coverage reports - the coverage files need to be in XML for them to work with codecov, so this commit also adds cobertura (XML) as a reporter --- ghost/adapter-manager/package.json | 2 +- ghost/bootstrap-socket/package.json | 2 +- ghost/config-url-helpers/package.json | 2 +- ghost/constants/package.json | 2 +- ghost/errors/package.json | 2 +- ghost/image-transform/package.json | 2 +- ghost/job-manager/package.json | 2 +- ghost/limit-service/package.json | 2 +- ghost/moleculer-service-from-class/package.json | 2 +- ghost/mw-session-from-token/package.json | 2 +- ghost/package-json/package.json | 2 +- ghost/pretty-cli/package.json | 2 +- ghost/promise/package.json | 2 +- ghost/release-utils/package.json | 2 +- ghost/security/package.json | 2 +- ghost/session-service/package.json | 2 +- ghost/settings-path-manager/package.json | 2 +- ghost/vhost-middleware/package.json | 2 +- ghost/zip/package.json | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ghost/adapter-manager/package.json b/ghost/adapter-manager/package.json index 7cdd58d2e8..ba799ee224 100644 --- a/ghost/adapter-manager/package.json +++ b/ghost/adapter-manager/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/bootstrap-socket/package.json b/ghost/bootstrap-socket/package.json index a2c7e7df64..6de4c2970c 100644 --- a/ghost/bootstrap-socket/package.json +++ b/ghost/bootstrap-socket/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/config-url-helpers/package.json b/ghost/config-url-helpers/package.json index 097bd6cb14..6f273fe2bc 100644 --- a/ghost/config-url-helpers/package.json +++ b/ghost/config-url-helpers/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 --check-coverage mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura --check-coverage mocha './test/**/*.test.js'", "coverage": "c8 report -r html", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" diff --git a/ghost/constants/package.json b/ghost/constants/package.json index 01f99f798a..e5eca6593a 100644 --- a/ghost/constants/package.json +++ b/ghost/constants/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/errors/package.json b/ghost/errors/package.json index d2bb15419c..b5b585234c 100644 --- a/ghost/errors/package.json +++ b/ghost/errors/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/image-transform/package.json b/ghost/image-transform/package.json index 3c5bf0213b..4685d30519 100644 --- a/ghost/image-transform/package.json +++ b/ghost/image-transform/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/job-manager/package.json b/ghost/job-manager/package.json index 22ca9d7750..54bc959330 100644 --- a/ghost/job-manager/package.json +++ b/ghost/job-manager/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/limit-service/package.json b/ghost/limit-service/package.json index af0411847e..1e1938017f 100644 --- a/ghost/limit-service/package.json +++ b/ghost/limit-service/package.json @@ -8,7 +8,7 @@ "exports": "./lib/limit-service.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/moleculer-service-from-class/package.json b/ghost/moleculer-service-from-class/package.json index 502efeecfe..518624e2f7 100644 --- a/ghost/moleculer-service-from-class/package.json +++ b/ghost/moleculer-service-from-class/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/mw-session-from-token/package.json b/ghost/mw-session-from-token/package.json index be72b9deb2..1c206832f7 100644 --- a/ghost/mw-session-from-token/package.json +++ b/ghost/mw-session-from-token/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/package-json/package.json b/ghost/package-json/package.json index 721a803bc0..08060e1c51 100644 --- a/ghost/package-json/package.json +++ b/ghost/package-json/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 --check-coverage mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura --check-coverage mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/pretty-cli/package.json b/ghost/pretty-cli/package.json index 3c32a891ac..b1436d21f5 100644 --- a/ghost/pretty-cli/package.json +++ b/ghost/pretty-cli/package.json @@ -8,7 +8,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/promise/package.json b/ghost/promise/package.json index 33f9aa6cba..4d6648ba0d 100644 --- a/ghost/promise/package.json +++ b/ghost/promise/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/release-utils/package.json b/ghost/release-utils/package.json index e5d012160f..8e1fb6b46e 100644 --- a/ghost/release-utils/package.json +++ b/ghost/release-utils/package.json @@ -7,7 +7,7 @@ "main": "lib/index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/security/package.json b/ghost/security/package.json index 1d6bdb880b..1e1ee0216e 100644 --- a/ghost/security/package.json +++ b/ghost/security/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/session-service/package.json b/ghost/session-service/package.json index a908bd243f..0a50673dd9 100644 --- a/ghost/session-service/package.json +++ b/ghost/session-service/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/settings-path-manager/package.json b/ghost/settings-path-manager/package.json index 278d978221..f8f65dba66 100644 --- a/ghost/settings-path-manager/package.json +++ b/ghost/settings-path-manager/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 --check-coverage mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura --check-coverage mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/vhost-middleware/package.json b/ghost/vhost-middleware/package.json index 7c297adece..c09b93aa37 100644 --- a/ghost/vhost-middleware/package.json +++ b/ghost/vhost-middleware/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" }, diff --git a/ghost/zip/package.json b/ghost/zip/package.json index ff0084300f..6ac2707242 100644 --- a/ghost/zip/package.json +++ b/ghost/zip/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "dev": "echo \"Implement me!\"", - "test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'", + "test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'", "lint": "eslint . --ext .js --cache", "posttest": "yarn lint" },