
In some cases, the `rule.adoc` at root of a rule is never included anywhere and thus is dead code. It's a maintenance cost by itself, but also it misses opportunities to inline code that seems used by two documents when in fact only one document is actually rendered. And this missed opportunity, in turn, stops us from applying the correct language tag on the code samples.
71 lines
1.4 KiB
Plaintext
71 lines
1.4 KiB
Plaintext
== Why is this an issue?
|
|
|
|
When a test fails due, for example, to infrastructure issues, you might want to ignore it temporarily. But without some kind of notation about why the test is being ignored, it may never be reactivated. Such tests are difficult to address without comprehensive knowledge of the project, and end up polluting their projects.
|
|
|
|
|
|
This rule raises an issue for each ignored test that does not have a ``++WorkItem++`` attribute nor a comment about why it is being skipped on the right side of the ``++Ignore++`` attribute.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,csharp]
|
|
----
|
|
[TestMethod]
|
|
[Ignore]
|
|
public void Test_DoTheThing()
|
|
{
|
|
// ...
|
|
}
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,csharp]
|
|
----
|
|
[TestMethod]
|
|
[Ignore] // renable when TCKT-1234 is fixed
|
|
public void Test_DoTheThing()
|
|
{
|
|
// ...
|
|
}
|
|
----
|
|
or
|
|
|
|
[source,csharp]
|
|
----
|
|
[TestMethod]
|
|
[Ignore]
|
|
[WorkItem(1234)]
|
|
public void Test_DoTheThing()
|
|
{
|
|
// ...
|
|
}
|
|
----
|
|
|
|
|
|
=== Exceptions
|
|
|
|
The rule doesn't raise an issue if:
|
|
|
|
* the test method is also marked with ``++WorkItem++`` attribute
|
|
* there is a comment on the right side of the ``++Ignore++`` attribute
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
include::../highlighting.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|