Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/mutation-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ jobs:
bin=$(go env GOBIN)
# gremlins reads the module root as `.`; given `./...` it finds no mutants at all. Each
# mutant reruns the tests, and the default timeout times out a race-enabled suite.
"${bin:-$(go env GOPATH)/bin}/gremlins" unleash --diff "$BASE" --timeout-coefficient 40 \
# --integration runs every test per mutant: otherwise gremlins tests the directory named
# after the Go package, so a mutant in `package main` runs no tests and reads as survived.
"${bin:-$(go env GOPATH)/bin}/gremlins" unleash --integration --diff "$BASE" --timeout-coefficient 40 \
--output "$RUNNER_TEMP/gremlins.json" .

- name: Mutate the changed TypeScript
Expand Down
9 changes: 9 additions & 0 deletions tests/test_mutation_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,12 @@ def test_a_report_that_is_not_json_is_named_but_does_not_fail(self) -> None:

if __name__ == "__main__":
unittest.main()


class TheWorkflow(unittest.TestCase):
def test_gremlins_runs_every_test_against_each_mutant(self) -> None:
# gremlins otherwise picks the package to test by finding a directory named after the Go
# package, so a mutant in `package main` under cmd/app runs no tests and reads as survived.
workflow = (Path(__file__).resolve().parents[1] / ".github/workflows/mutation-report.yml").read_text()
unleash = next(line for line in workflow.splitlines() if "gremlins\" unleash" in line)
self.assertIn("--integration", unleash)
Loading