mirror of https://github.com/apache/lucene.git
LUCENE-5475: upgraded randomized testing to 2.1.1. This will print full annotations on assumption-ignored tests. It also includes more fancy test filtering.:
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1576292 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ffca357397
commit
0630aad05e
|
@ -989,6 +989,7 @@
|
|||
<propertyref prefix="tests.timeoutSuite" />
|
||||
<propertyref prefix="tests.jettyConnector" />
|
||||
<propertyref prefix="tests.disableHdfs" />
|
||||
<propertyref prefix="tests.filter" />
|
||||
</syspropertyset>
|
||||
|
||||
<!-- Pass randomized settings to the forked JVM. -->
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
package org.apache.lucene.util.junitcompat;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.annotations.TestGroup;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
public class TestGroupFiltering extends LuceneTestCase {
|
||||
@Documented
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@TestGroup(enabled = false)
|
||||
public @interface Foo {}
|
||||
|
||||
@Documented
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@TestGroup(enabled = false)
|
||||
public @interface Bar {}
|
||||
|
||||
@Documented
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@TestGroup(enabled = false)
|
||||
public @interface Jira {
|
||||
String bug();
|
||||
}
|
||||
|
||||
@Foo
|
||||
public void testFoo() {}
|
||||
|
||||
@Foo @Bar
|
||||
public void testFooBar() {}
|
||||
|
||||
@Bar
|
||||
public void testBar() {}
|
||||
|
||||
@Jira(bug = "JIRA bug reference")
|
||||
public void testJira() {}
|
||||
}
|
|
@ -28,6 +28,7 @@ import org.apache.lucene.util.TestRuleIgnoreTestSuites;
|
|||
import org.apache.lucene.util.TestRuleMarkFailure;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Assume;
|
||||
import org.junit.Before;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Rule;
|
||||
|
@ -73,6 +74,13 @@ public abstract class WithNestedTests {
|
|||
private TestRuleIgnoreAfterMaxFailures prevRule;
|
||||
|
||||
protected void before() throws Throwable {
|
||||
String filter = System.getProperty("tests.filter");
|
||||
if (filter != null && !filter.trim().isEmpty()) {
|
||||
// We're running with a complex test filter. This will affect nested tests anyway
|
||||
// so ignore them.
|
||||
Assume.assumeTrue(false);
|
||||
}
|
||||
|
||||
TestRuleIgnoreAfterMaxFailures newRule = new TestRuleIgnoreAfterMaxFailures(Integer.MAX_VALUE);
|
||||
prevRule = LuceneTestCase.replaceMaxFailureRule(newRule);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
/cglib/cglib-nodep = 2.2
|
||||
/com.adobe.xmp/xmpcore = 5.1.2
|
||||
|
||||
com.carrotsearch.randomizedtesting.version = 2.0.13
|
||||
com.carrotsearch.randomizedtesting.version = 2.1.1
|
||||
/com.carrotsearch.randomizedtesting/junit4-ant = ${com.carrotsearch.randomizedtesting.version}
|
||||
/com.carrotsearch.randomizedtesting/randomizedtesting-runner = ${com.carrotsearch.randomizedtesting.version}
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
33904a47c5f920d270437ea1075cc9fa5ecb8099
|
|
@ -0,0 +1 @@
|
|||
a8a7371e11a8b3a4a3eeea81ad3cedafe3e3550e
|
|
@ -1 +0,0 @@
|
|||
bdacac985583621c50de414b1d45b1e6e43f6d1f
|
|
@ -0,0 +1 @@
|
|||
5908c4e714dab40ccc892993a21537c7c0d6210c
|
Loading…
Reference in New Issue