Skip to content

Commit 4738a43

Browse files
committed
README.md document selective skipping of tests
1 parent ccc0832 commit 4738a43

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

tck/README.md

+25
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,31 @@ The additional and confiruration options are reflect the options available in th
324324

325325
The `IdentityProcessorVerification` also runs additional sanity Verifications, which are not directly mapped to Specification rules, but help to verify that a Processor won't "get stuck" or face similar problems. Please refer to the sources for details on the tests included.
326326

327+
## Ignoring tests
328+
Since you inherit these tests instead of defining them yourself it's not possible to use the usual `@Ignore` annotations to skip certain tests
329+
(which may be perfectly reasonable if your implementation has some know constraints on what it cannot implement) we recommend the below pattern
330+
to skip tests inherited from the TCK's base classes:
331+
332+
```java
333+
public class SkippingIdentityProcessorTest extends org.reactivestreams.tck.IdentityProcessorVerification<Integer> {
334+
335+
public SkippingIdentityProcessorTest() {
336+
super(new TestEnvironment(500, true), 1000);
337+
}
338+
339+
@Override
340+
public Processor<Integer, Integer> createIdentityProcessor(int bufferSize) {
341+
return /* ... */;
342+
}
343+
344+
@Override // override the test method, and provide a reason on why you're doing so in the notVerified() message
345+
public void spec999_mustDoVeryCrazyThings() throws Throwable {
346+
notVerified("Unable to implement test because ...");
347+
}
348+
349+
}
350+
```
351+
327352
## Upgrade story
328353

329354
**TODO** - What is our story about updating the TCK? How do we make sure that implementations don't accidentally miss some change in the spec, if the TCK is unable to fail verify the new behavior? Comments are very welcome, discussion about this is under-way in [Issue #99 – TCK Upgrade Story](https://github.com/reactive-streams/reactive-streams/issues/99).

tck/src/main/java/org/reactivestreams/tck/IdentityProcessorVerification.java

+8
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,14 @@ public void mustRequestFromUpstreamForElementsThatHaveBeenRequestedLongAgo() thr
627627

628628
/////////////////////// TEST INFRASTRUCTURE //////////////////////
629629

630+
public void notVerified() {
631+
publisherVerification.notVerified();
632+
}
633+
634+
public void notVerified(String message) {
635+
publisherVerification.notVerified(message);
636+
}
637+
630638
public abstract class TestSetup extends ManualPublisher<T> {
631639
final private ManualSubscriber<T> tees; // gives us access to an infinite stream of T values
632640
private Set<T> seenTees = new HashSet<T>();

0 commit comments

Comments
 (0)