Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0.0.beta - Skipped tests with coverage analysis can result in an error #2485

Closed
nicojs opened this issue Sep 17, 2020 · 0 comments · Fixed by #2487
Closed

4.0.0.beta - Skipped tests with coverage analysis can result in an error #2485

nicojs opened this issue Sep 17, 2020 · 0 comments · Fixed by #2487
Labels
🐛 Bug Something isn't working
Milestone

Comments

@nicojs
Copy link
Member

nicojs commented Sep 17, 2020

When running Stryker on "vscode-python" (thanks @gramster for this gem 💎), you can run into this error:

11:13:28 (1251) ERROR Stryker an error occurred InjectionError: Could not inject [class MutationTestExecutor] -> [token "mutantsWithTestCoverage"] -> [function findMutantTestCoverage]. Cause: Found test with id "Process - PythonExecutionFactory Without a resource Ensure create returns a CondaExecutionService instance if createCondaExecutionService() returns a valid object" in coverage data, but not in the test results of the dry run. This shouldn't happen! Please report the issue at the issue tracker of your stryker test runner

The message is self explanatory. There appears to be data missing in the dry run result.

The specified test looks like this:

test('Ensure `create` returns a CondaExecutionService instance if createCondaExecutionService() returns a valid object', async function () {
  // tslint:disable-next-line:no-invalid-this
  return this.skip();
  // [...]  
});

My conclusion is that we're not handling skipped tests correctly.

@nicojs nicojs added the 🐛 Bug Something isn't working label Sep 17, 2020
@nicojs nicojs added this to the 4.0 milestone Sep 17, 2020
nicojs added a commit that referenced this issue Sep 17, 2020
Allow for a coverage per test result for a non-existing test. This can happen when you add a `this.skip` inside a `it`. In that case, `beforeEach` still executes and can add test coverage.

We now ignore simply ignore this and log a debug message.

Fixes #2485
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant