|
23 | 23 | import lombok.Setter;
|
24 | 24 | import neo4j.org.testkit.backend.TestkitState;
|
25 | 25 | import neo4j.org.testkit.backend.messages.responses.RunTest;
|
| 26 | +import neo4j.org.testkit.backend.messages.responses.SkipTest; |
26 | 27 | import neo4j.org.testkit.backend.messages.responses.TestkitResponse;
|
27 | 28 |
|
| 29 | +import java.util.LinkedHashMap; |
| 30 | +import java.util.Map; |
| 31 | + |
28 | 32 | @Setter
|
29 | 33 | @Getter
|
30 | 34 | @NoArgsConstructor
|
31 | 35 | public class StartTest implements TestkitRequest
|
32 | 36 | {
|
| 37 | + private static final Map<String,String> SKIP_PATTERN_TO_REASON = new LinkedHashMap<>(); |
| 38 | + |
| 39 | + static |
| 40 | + { |
| 41 | + SKIP_PATTERN_TO_REASON.put( "^.*retry.TestRetryClustering.test_retry_database_unavailable$", "The test is not applicable to 4.2 driver" ); |
| 42 | + SKIP_PATTERN_TO_REASON.put( "^.*retry.TestRetryClustering.test_retry_made_up_transient$", "The test is not applicable to 4.2 driver" ); |
| 43 | + SKIP_PATTERN_TO_REASON.put( "^.*retry.TestRetryClustering.test_retry_ForbiddenOnReadOnlyDatabase$", "The test is not applicable to 4.2 driver" ); |
| 44 | + SKIP_PATTERN_TO_REASON.put( "^.*retry.TestRetryClustering.test_retry_NotALeader$", "The test is not applicable to 4.2 driver" ); |
| 45 | + SKIP_PATTERN_TO_REASON |
| 46 | + .put( "^.*retry.TestRetryClustering.test_retry_ForbiddenOnReadOnlyDatabase_ChangingWriter$", "The test is not applicable to 4.2 driver" ); |
| 47 | + SKIP_PATTERN_TO_REASON.put( "^.*routing.Routing\\..+$", "The tests are not applicable to 4.2 driver" ); |
| 48 | + SKIP_PATTERN_TO_REASON |
| 49 | + .put( "^.+routing.Routing.*\\.test_should_successfully_get_server_protocol_version$", "The test is not applicable to 4.2 driver" ); |
| 50 | + SKIP_PATTERN_TO_REASON.put( "^.+routing.Routing.*\\.test_should_successfully_get_server_agent$", "The test is not applicable to 4.2 driver" ); |
| 51 | + } |
| 52 | + |
33 | 53 | private StartTestBody data;
|
34 | 54 |
|
35 | 55 | @Override
|
36 | 56 | public TestkitResponse process( TestkitState testkitState )
|
37 | 57 | {
|
38 |
| - return RunTest.builder().build(); |
| 58 | + return SKIP_PATTERN_TO_REASON |
| 59 | + .entrySet() |
| 60 | + .stream() |
| 61 | + .filter( entry -> data.getTestName().matches( entry.getKey() ) ) |
| 62 | + .findFirst() |
| 63 | + .map( entry -> (TestkitResponse) SkipTest.builder() |
| 64 | + .data( SkipTest.SkipTestBody.builder() |
| 65 | + .reason( entry.getValue() ) |
| 66 | + .build() ) |
| 67 | + .build() ) |
| 68 | + .orElseGet( () -> RunTest.builder().build() ); |
39 | 69 | }
|
40 | 70 |
|
41 | 71 | @Setter
|
|
0 commit comments