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

Introduce @MetafixToDo annotation to mark tests as disabled. #158

Merged
merged 1 commit into from
Feb 17, 2022

Conversation

blackwinter
Copy link
Member

Since we're keeping quite a few disabled tests in stock that indicate pending work (which is a good thing), it's not always clear (to me, at least) when any of those tests might be resolved due to (seemingly unrelated) fixes. So I'd like to propose a new @MetafixToDo annotation instead of the current @Disabled annotation, which takes care of reminding us of no longer failing tests: Failing tests marked as "to do" will be reported as skipped (just as before¹); passing tests marked as "to do" will be reported as failed (so we know we can remove the annotation).

¹ Except not quite: One problem with the proposed approach is that the log messages of still failing tests somewhat clutter the test output. We could reduce the log level for tests to ERROR as a remedy. OTOH, it's not entirely useless to see those messages, because sometimes disabled tests fail for the wrong reason ;) (see MetafixSelectorTest.reject() for instance).

Similar to `org.junit.jupiter.api.Disabled`, but ensures that fixed tests don't stay disabled.

Failing tests marked as "to do" will be reported as *skipped*; passing tests marked as "to do" will be reported as *failed*.
Copy link
Member

@fsteeg fsteeg left a comment

Choose a reason for hiding this comment

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

Nice! (Just today I was trying to find some way to run only disabled tests to check if a change makes any of them pass.)

@blackwinter
Copy link
Member Author

Haha, what a coincidence :)

@blackwinter blackwinter merged commit 69e34aa into master Feb 17, 2022
@blackwinter blackwinter deleted the introduceToDoAnnotation branch February 17, 2022 17:24
@blackwinter blackwinter assigned blackwinter and unassigned fsteeg Feb 17, 2022
blackwinter added a commit that referenced this pull request Feb 21, 2022
Set `org.metafacture.metafix.disableToDo=true` to mimic previous `@Disabled` behaviour.
@blackwinter
Copy link
Member Author

Since it's getting a bit unwieldy in day-to-day work after all, I've added (f4a7523) a system property org.metafacture.metafix.disableToDo=<boolean> to optionally disable all @MetafixToDos, so they're equivalent to @Disabled before. Personally, I'm running test with this setting enabled and check with this setting disabled (unset), which appears to hit the sweet spot for me.

blackwinter added a commit that referenced this pull request Mar 3, 2022
Similar to previous `disabled.txt`, but ensures that fixed integration tests don't stay disabled.

Failing tests marked as "to do" will be reported as *skipped*; passing tests marked as "to do" will be reported as *failed*.

Set environment variable `METAFIX_DISABLE_TO_DO=true` (or system property `org.metafacture.metafix.disableToDo=true` when run via Gradle) to mimic previous `disabled.txt` behaviour.

Analogous to `@MetafixToDo` annotation in unit tests (see #158 and f4a7523).
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