diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e1d6e42..a2a8a96 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @Miexil @JulienVannier66 @upfluence/frontend +* @Miexil @phndiaye @upfluence/frontend diff --git a/index.js b/index.js index e0d7ee9..00dcd2d 100644 --- a/index.js +++ b/index.js @@ -17,6 +17,9 @@ module.exports = { setOwnConfig: { buildEnv: process.BUILD_ENV || 'staging' } + }, + babel: { + plugins: [...require('ember-cli-code-coverage').buildBabelPlugin()] } }, diff --git a/package.json b/package.json index 7f9f29b..7e826e6 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "ember-cli-moment-shim": "^3.7.1", "ember-cli-sri": "^2.1.1", "ember-cli-typescript-blueprints": "^3.0.0", - "ember-cli-code-coverage": "^1.0.2", + "ember-cli-code-coverage": "^3.0.0", "ember-disable-prototype-extensions": "^1.1.3", "ember-export-application-global": "^2.0.1", "ember-load-initializers": "^2.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 426dd1b..ea1a161 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -135,8 +135,8 @@ devDependencies: specifier: ~3.18.0 version: 3.18.0(react-dom@16.14.0)(react@16.14.0) ember-cli-code-coverage: - specifier: ^1.0.2 - version: 1.0.3 + specifier: ^3.0.0 + version: 3.0.0 ember-cli-dependency-checker: specifier: ^3.2.0 version: 3.3.2(ember-cli@3.18.0) @@ -6325,7 +6325,7 @@ packages: dev: true /ee-first@1.1.1: - resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: true /electron-to-chromium@1.4.643: @@ -6466,16 +6466,26 @@ packages: transitivePeerDependencies: - supports-color - /ember-cli-code-coverage@1.0.3: - resolution: {integrity: sha512-tyWeQ22vxpDmfhIrRCMqZPq9Coppefg19hBgME4yb9Na2qslxCNK0USThigZhesb7hfw2ZgdrKJCrmCVNwkq7g==} - engines: {node: 10.* || >= 12} + /ember-cli-code-coverage@3.0.0: + resolution: {integrity: sha512-IAVET5oKS0IkEAPUTKOzHlNk1Z+986//8LZmfqhkSGkGJ76tFLw8AAS+BloUctX7J/xCUNn/1voBVqb5oabMPw==} + engines: {node: '>= 18'} + peerDependencies: + '@embroider/compat': ^0.47.0 || ^1.0.0 || ^2.0.0 || >=3.0.0 + '@embroider/core': ^0.47.0 || ^1.0.0 || ^2.0.0 || >=3.0.0 + peerDependenciesMeta: + '@embroider/compat': + optional: true + '@embroider/core': + optional: true dependencies: babel-plugin-istanbul: 6.1.1 body-parser: 1.20.1 - ember-cli-version-checker: 5.1.2 + ember-cli-babel: 7.26.11 + express: 4.18.2 fs-extra: 9.1.0 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 4.0.1 istanbul-reports: 3.1.6 node-dir: 0.1.17 walk-sync: 2.2.0 @@ -9491,6 +9501,17 @@ packages: supports-color: 7.2.0 dev: true + /istanbul-lib-source-maps@4.0.1: + resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} + engines: {node: '>=10'} + dependencies: + debug: 4.3.4 + istanbul-lib-coverage: 3.2.2 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + dev: true + /istanbul-reports@3.1.6: resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} engines: {node: '>=8'} @@ -10131,7 +10152,7 @@ packages: dev: true /media-typer@0.3.0: - resolution: {integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=} + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} dev: true diff --git a/scripts/generate_sonar_report b/scripts/generate_sonar_report index 60b147b..f4e98dd 100755 --- a/scripts/generate_sonar_report +++ b/scripts/generate_sonar_report @@ -18,7 +18,7 @@ fi echo "" echo "" echo "[Step2] Run ember test - dot reporter to generate lcovinfo file" -COVERAGE=true ember test +COVERAGE=true ember test --silent -r dot --filter=!Wednesday ## Check that coverage folder has been generated echo "" @@ -35,7 +35,6 @@ fi echo "" echo "" echo "[Step4] Run sonar-scanner" -echo "Grab a coffee, this is going to be a long one. (~15mins)" -sonar-scanner -D sonar.projectVersion=$(git describe --tags --abbrev=0) +sonar-scanner -Dsonar.projectVersion=$(git describe --tags --abbrev=0) -Dsonar.login=$SONARCLOUD_FRONTEND_TOKEN echo "[Success]" diff --git a/sonar-project.properties b/sonar-project.properties index 3423cb5..61f1eb1 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,5 @@ sonar.projectKey=hyperevents -sonar.host.url=https://sonarcloud.io +sonar.host.url=https://sonarqube.upfluence.co sonar.organization=upfluence sonar.sources=addon/,app/ sonar.javascript.lcov.reportPaths=./coverage/lcov.info diff --git a/tests/test-helper.ts b/tests/test-helper.ts index e855de4..e12102e 100644 --- a/tests/test-helper.ts +++ b/tests/test-helper.ts @@ -6,11 +6,17 @@ import { setApplication } from '@ember/test-helpers'; import { start } from 'ember-qunit'; import * as QUnit from 'qunit'; import { setup } from 'qunit-dom'; +// @ts-ignore +import { forceModulesToBeLoaded, sendCoverage } from 'ember-cli-code-coverage/test-support'; setup(QUnit.assert); // @ts-ignore setApplication(Application.create(config.APP)); +QUnit.done(async function () { + forceModulesToBeLoaded(); + await sendCoverage(); +}); start();