diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000000..e2a23c23d8 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,3 @@ +codecov: + notify: + require_ci_to_pass: no diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d63f6ca37..b1d2c11b31 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,7 +53,8 @@ unit: image: $CI_IMAGE script: - yarn - - yarn test + - yarn test:unit + - ./scripts/codecov.sh bundle-e2e: stage: test diff --git a/package.json b/package.json index 6545d41d0c..596943e4f4 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@wdio/spec-reporter": "5.16.5", "@wdio/sync": "5.16.9", "body-parser": "1.19.0", + "codecov": "3.6.1", "cors": "2.8.5", "express": "4.17.1", "istanbul-instrumenter-loader": "3.0.1", diff --git a/scripts/codecov.sh b/scripts/codecov.sh new file mode 100755 index 0000000000..f0be9256ea --- /dev/null +++ b/scripts/codecov.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export CODECOV_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.browser-sdk.codecov_token --with-decryption --query "Parameter.Value" --out text) +yarn codecov -t "${CODECOV_TOKEN}" -f coverage/coverage-final.json diff --git a/test/unit/karma.local.conf.js b/test/unit/karma.local.conf.js index d428b45077..a1a4ef28c3 100644 --- a/test/unit/karma.local.conf.js +++ b/test/unit/karma.local.conf.js @@ -7,7 +7,7 @@ module.exports = function(config) { reporters: ['coverage-istanbul', ...karmaBaseConf.reporters], browsers: ['ChromeHeadlessNoSandbox'], coverageIstanbulReporter: { - reports: ['html', 'text-summary'], + reports: ['html', 'text-summary', 'json'], dir: path.join(__dirname, '../../coverage'), }, customLaunchers: { diff --git a/yarn.lock b/yarn.lock index 51decd7601..772ceba664 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1639,6 +1639,11 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argv@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/argv/-/argv-0.0.2.tgz#ecbd16f8949b157183711b1bda334f37840185ab" + integrity sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas= + arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" @@ -2611,6 +2616,17 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= +codecov@3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.6.1.tgz#f39fc49413445555f81f8e3ca5730992843b4517" + integrity sha512-IUJB6WG47nWK7o50etF8jBadxdMw7DmoQg05yIljstXFBGB6clOZsIj6iD4P82T2YaIU3qq+FFu8K9pxgkCJDQ== + dependencies: + argv "^0.0.2" + ignore-walk "^3.0.1" + js-yaml "^3.13.1" + teeny-request "^3.11.3" + urlgrey "^0.4.4" + collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -6821,7 +6837,7 @@ node-fetch-npm@^2.0.2: json-parse-better-errors "^1.0.0" safe-buffer "^5.1.1" -node-fetch@^2.3.0, node-fetch@^2.5.0: +node-fetch@^2.2.0, node-fetch@^2.3.0, node-fetch@^2.5.0: version "2.6.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== @@ -9073,6 +9089,15 @@ tar@^4.4.10, tar@^4.4.12, tar@^4.4.8: safe-buffer "^5.1.2" yallist "^3.0.3" +teeny-request@^3.11.3: + version "3.11.3" + resolved "https://registry.yarnpkg.com/teeny-request/-/teeny-request-3.11.3.tgz#335c629f7645e5d6599362df2f3230c4cbc23a55" + integrity sha512-CKncqSF7sH6p4rzCgkb/z/Pcos5efl0DmolzvlqRQUNcpRIruOhY9+T1FsIlyEbfWd7MsFpodROOwHYh2BaXzw== + dependencies: + https-proxy-agent "^2.2.1" + node-fetch "^2.2.0" + uuid "^3.3.2" + temp-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" @@ -9653,6 +9678,11 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" +urlgrey@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-0.4.4.tgz#892fe95960805e85519f1cd4389f2cb4cbb7652f" + integrity sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8= + use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"