Skip to content

Commit

Permalink
ci(stryker): dedicated config for stryker in ci (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinezanardi committed Oct 16, 2023
1 parent 82d1f93 commit 307b9de
Show file tree
Hide file tree
Showing 7 changed files with 25,580 additions and 25,379 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ jobs:
run: npm run docker:test:start

- name: Mutant tests 👽
run: npm run test:stryker
run: npm run test:stryker:ci

- name: Stop Docker containers 🐳
run: npm run docker:test:stop
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
run: npm run docker:test:start

- name: Mutant tests 👽
run: npm run test:stryker
run: npm run test:stryker:ci

- name: Stop Docker containers 🐳
run: npm run docker:test:stop
Expand Down
4 changes: 3 additions & 1 deletion config/eslint/rules/overrides/config-files.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const { OFF } = require("../../constants");

const configFilesOverride = Object.freeze({
files: ["./config/**/*.ts"],
files: ["./config/**/*.ts", "./config/**/*.js"],
rules: {
"@typescript-eslint/no-require-imports": OFF,
"@typescript-eslint/no-restricted-imports": OFF,
"@typescript-eslint/no-var-requires": OFF,
"import/no-default-export": OFF,
"import/no-relative-parent-imports": OFF,
},
Expand Down
25 changes: 25 additions & 0 deletions config/stryker/stryker-ci.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const defaultConfig = require("./stryker.conf");

const reporters = ["progress-append-only"];

const dashboard = {
project: "github.com/antoinezanardi/werewolves-assistant-api-next",
baseUrl: "https://dashboard.stryker-mutator.io/api/reports",
reportType: "full",
};
const version = process.env.VERSION;

if (process.env.STRYKER_DASHBOARD_API_KEY !== undefined) {
reporters.push("dashboard");
}

if (process.env.VERSION !== undefined) {
dashboard.version = version;
}

module.exports = {
...defaultConfig,
dryRunTimeoutMinutes: 10,
reporters,
dashboard,
};
19 changes: 1 addition & 18 deletions config/stryker/stryker.conf.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
const reporters = ["clear-text", "progress", "html", "json"];
const dashboard = {
project: "github.com/antoinezanardi/werewolves-assistant-api-next",
baseUrl: "https://dashboard.stryker-mutator.io/api/reports",
reportType: "full",
};
const version = process.env.VERSION;

if (process.env.STRYKER_DASHBOARD_API_KEY !== undefined) {
reporters.push("dashboard");
}

if (process.env.VERSION !== undefined) {
dashboard.version = version;
}

module.exports = {
cleanTempDir: "always",
incremental: true,
Expand All @@ -29,7 +13,7 @@ module.exports = {
"!**/*.constant.ts",
],
jest: { configFile: "config/jest/jest-global.ts" },
reporters,
reporters: ["clear-text", "progress", "html", "json"],
htmlReporter: { fileName: "tests/stryker/coverage/index.html" },
jsonReporter: { fileName: "tests/stryker/coverage/mutation.json" },
thresholds: {
Expand All @@ -38,5 +22,4 @@ module.exports = {
break: 100,
},
disableTypeChecks: "{tests,src,lib}/**/*.{js,ts,jsx,tsx,html,vue}",
dashboard,
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"test:cov": "NODE_ENV=test jest --coverage --config config/jest/jest-global.ts",
"test:stryker": "NODE_ENV=test rimraf tests/stryker/coverage && stryker run config/stryker/stryker.conf.js",
"test:stryker:force": "NODE_ENV=test rimraf tests/stryker/incremental.json tests/stryker/coverage && stryker run config/stryker/stryker.conf.js --force",
"test:stryker:ci": "NODE_ENV=test rimraf tests/stryker/coverage && stryker run config/stryker/stryker-ci.conf.js",
"test:unit": "NODE_ENV=test jest --config config/jest/jest-unit.ts",
"test:unit:watch": "NODE_ENV=test jest --watch --config config/jest/jest-unit.ts",
"test:unit:cov": "NODE_ENV=test rimraf tests/unit/coverage && jest --coverage --config config/jest/jest-unit.ts",
Expand Down
50,906 changes: 25,548 additions & 25,358 deletions tests/stryker/incremental.json

Large diffs are not rendered by default.

0 comments on commit 307b9de

Please sign in to comment.