-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
Configures and runs [Stryker](https://stryker-mutator.io/), a mutation tester.
@@ -66,6 +66,10 @@ test: export TARGET = dev | |||
test: ## Run the tests | |||
${DOCKER_COMPOSE} run --rm app npm run test | |||
|
|||
test\:mutation: export TARGET = dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these additional explicit exports required. Doesn't the makefile set these up at the top?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It forces TARGET
to be dev
for test:mutation
(ie TARGET=prod make test:mutation
continues to work as TARGET=prod
is ignored).
"mutate": [ | ||
"src/**/*.ts" | ||
], | ||
"mutator": "typescript", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the time or mutation/tests number budget here? In theory it could run forever but there must be a limit in place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean is how to make it generate more mutations, but the code may be too simple for that. Adding a couple of operations in src/app.ts
raises the number of mutants:
Ran 1.60 tests per mutant on average.
----------|---------|----------|-----------|------------|----------|---------|
File | % score | # killed | # timeout | # survived | # no cov | # error |
----------|---------|----------|-----------|------------|----------|---------|
All files | 25.00 | 1 | 0 | 3 | 0 | 1 |
app.ts | 25.00 | 1 | 0 | 3 | 0 | 1 |
----------|---------|----------|-----------|------------|----------|---------|
14:03:00 (17) ERROR MutationTestReportCalculator Final mutation score 25.00 under breaking threshold 100, setting exit code to
1 (failure).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libero/article-store#167 shows more usage.
Co-Authored-By: Giorgio Sironi <accounts@giorgiosironi.com>
], | ||
"testRunner": "jest", | ||
"thresholds": { | ||
"break": 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explored whether to set high
thinking that the 80% default wouldn't be matching. Doesn't change anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Configures and runs Stryker, a mutation tester.