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

Add timeout as configurable coverage criteria #1118

Merged
merged 4 commits into from
Nov 22, 2020
Merged

Conversation

mbj
Copy link
Owner

@mbj mbj commented Nov 22, 2020

No description provided.

@mbj mbj force-pushed the timeout/configures branch 6 times, most recently from b234ad1 to f4c40aa Compare November 22, 2020 04:53
private_constant(*constants(false))

class CoverageCriteria
include Anima.new(:timeout, :test_result)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dgollahon The next step is to allow to configure the coverage criteria per subject in the config file an in-line.

Same for the mutation timeout.

The ideal setting than is a global "high" timeout with coverage_criteria.timeout = false and a per subject one after manual review (From an alive, example an infinite loop) setting it to true.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also there are more possible criteria like warnings etc.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the most important criteria for @pawelpacana counting ruby aborts as killed.

#1054.

Next major feature for 0.10.8. The infrastructure exists now.

Per subject config will be added in 0.10.9 possibly also in-line configuration.

#
# @return [undefined]
def run
visit(MutationResult, object.mutation_result)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pass through ATM, I could evision a verbose mode where we show covered mutations, and tell why they where killed.

@@ -7,7 +7,7 @@ class Printer
# Subject result printer
class SubjectResult < self

delegate :subject, :alive_mutation_results, :tests
delegate :subject, :uncovered_results, :tests
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slowly moving the wording away from "alive" and "killed" to "uncovered" and "covered".

else
0.0
end
isolation_result.value&.runtime || 0.0
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its now perfectly valid there is no value returned from the isolation. And the status of the islation result cannot be determined anymore without the coverage criteria coming from the outside.

@mbj mbj self-assigned this Nov 22, 2020
@mbj mbj merged commit dd48b9d into master Nov 22, 2020
@mbj mbj deleted the timeout/configures branch November 22, 2020 05:10

```yml
---
coverage_criteria:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to set this via CLI flag? Once we have per-subject / per file config then customizing it that way would be good but I am thinking of doing something like having the fork abort coverage off in my local config (so I can find and report bugs) but considering it as a kill in CI so that PRs are never gated by segfaults.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing to configure each subject separately is the next step.

But: Its unlikely it makes sense in the CLI, simply because the CLI would become very long. My next initiative would be to support inheriting (prefix match) based per subject configuration in the code, and use the config file as input.

Than the overnext step to support it from in-line code comments.

Only after that I'll consider making CLI (per subject) support for these.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, yeah, I think that makes sense. Looking forward to it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants