You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2021/11/24 07:33:49 UTC
[lucene] 01/02: LUCENE-10168: Only test N-2 codecs on nightly runs.
This is an automated email from the ASF dual-hosted git repository.
jpountz pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git
commit 3f634e2ab90f55d0d79472608bf7f74644551548
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Tue Nov 23 09:12:59 2021 +0100
LUCENE-10168: Only test N-2 codecs on nightly runs.
In order for tests to keep running fast, this annotates all tests of N-2 codecs
with `@Nightly`. To keep good coverage of releases, the smoke tester is now
configured to run nightly tests.
---
dev-tools/scripts/smokeTestRelease.py | 6 ++++++
.../lucene70/TestLucene70DocValuesFormat.java | 2 ++
.../backward_codecs/lucene70/TestLucene70NormsFormat.java | 2 ++
.../lucene/backward_index/TestBackwardsCompatibility.java | 13 ++++++++-----
.../org/apache/lucene/index/BaseCompoundFormatTestCase.java | 1 +
5 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py
index 4e98dd4..04bfc13 100755
--- a/dev-tools/scripts/smokeTestRelease.py
+++ b/dev-tools/scripts/smokeTestRelease.py
@@ -1129,6 +1129,12 @@ def smokeTest(java, baseURL, gitRevision, version, tmpDir, isSigned, local_keys,
# disable flakey tests for smoke-tester runs:
testArgs = '-Dtests.badapples=false %s' % testArgs
+ # Tests annotated @Nightly are more resource-intensive but often cover
+ # important code paths. They're disabled by default to preserve a good
+ # developer experience, but we enable them for smoke tests where we want good
+ # coverage.
+ testArgs = '-Dtests.nigthly=true %s' % testArgs
+
if FORCE_CLEAN:
if os.path.exists(tmpDir):
raise RuntimeError('temp dir %s exists; please remove first' % tmpDir)
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70DocValuesFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70DocValuesFormat.java
index 894b2c1..d56ded6 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70DocValuesFormat.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70DocValuesFormat.java
@@ -66,9 +66,11 @@ import org.apache.lucene.store.ByteBuffersDataOutput;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.BytesRefBuilder;
+import org.apache.lucene.util.LuceneTestCase.Nightly;
import org.apache.lucene.util.TestUtil;
/** Tests Lucene70DocValuesFormat */
+@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene70DocValuesFormat extends BaseCompressingDocValuesFormatTestCase {
private final Codec codec = TestUtil.alwaysDocValuesFormat(new Lucene70DocValuesFormat());
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70NormsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70NormsFormat.java
index 5530235..2c503a4 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70NormsFormat.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_codecs/lucene70/TestLucene70NormsFormat.java
@@ -18,8 +18,10 @@ package org.apache.lucene.backward_codecs.lucene70;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.index.BaseNormsFormatTestCase;
+import org.apache.lucene.util.LuceneTestCase.Nightly;
/** Tests Lucene70NormsFormat */
+@Nightly // N-2 formats are only tested on nightly runs
public class TestLucene70NormsFormat extends BaseNormsFormatTestCase {
@Override
protected Codec getCodec() {
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
index 2962293..11f69688 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/backward_index/TestBackwardsCompatibility.java
@@ -1037,11 +1037,13 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
searchIndex(oldIndexDirs.get(name), name, Version.MIN_SUPPORTED_MAJOR);
}
- for (String name : binarySupportedNames) {
- Path oldIndexDir = createTempDir(name);
- TestUtil.unzip(getDataInputStream("unsupported." + name + ".zip"), oldIndexDir);
- try (BaseDirectoryWrapper dir = newFSDirectory(oldIndexDir)) {
- searchIndex(dir, name, MIN_BINARY_SUPPORTED_MAJOR);
+ if (TEST_NIGHTLY) {
+ for (String name : binarySupportedNames) {
+ Path oldIndexDir = createTempDir(name);
+ TestUtil.unzip(getDataInputStream("unsupported." + name + ".zip"), oldIndexDir);
+ try (BaseDirectoryWrapper dir = newFSDirectory(oldIndexDir)) {
+ searchIndex(dir, name, MIN_BINARY_SUPPORTED_MAJOR);
+ }
}
}
}
@@ -2096,6 +2098,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
}
}
+ @Nightly
public void testReadNMinusTwoCommit() throws IOException {
for (String name : binarySupportedNames) {
Path oldIndexDir = createTempDir(name);
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
index cb20755..46fab1c 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
@@ -165,6 +165,7 @@ public abstract class BaseCompoundFormatTestCase extends BaseIndexFileFormatTest
}
// LUCENE-5724: actually test we play nice with NRTCachingDir and massive file
+ @Slow
public void testLargeCFS() throws IOException {
final String testfile = "_123.test";
IOContext context = new IOContext(new FlushInfo(0, 512 * 1024 * 1024));