Skip to content

Commit 4ddd20c

Browse files
Allow override of ref tests root (Consensys#8166)
1 parent 3d91f17 commit 4ddd20c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: eth-tests/src/main/java/tech/pegasys/teku/ethtests/finder/ReferenceTestFinder.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
@SuppressWarnings("MustBeClosedChecker")
2727
public class ReferenceTestFinder {
2828

29+
// Can be overridden with -Dteku.ref-test-module.override-root="<path>"
2930
private static final Path TEST_PATH_FROM_MODULE =
3031
Path.of("src", "referenceTest", "resources", "consensus-spec-tests", "tests");
3132
private static final List<String> SUPPORTED_FORKS =
@@ -77,13 +78,18 @@ public static Path findReferenceTestRootDirectory() {
7778
Path.of(System.getProperty("user.dir"), "eth-reference-tests") // Run from teku root
7879
);
7980
return searchPaths.stream()
80-
.map(path -> path.resolve(TEST_PATH_FROM_MODULE))
81+
.map(
82+
path ->
83+
path.resolve(
84+
System.getProperty(
85+
"teku.ref-test-module.override-root", TEST_PATH_FROM_MODULE.toString())))
8186
.filter(path -> path.toFile().exists())
8287
.findFirst()
8388
.orElseThrow(
8489
() ->
8590
new IllegalStateException(
86-
"Unable to find the reference tests module. Try setting teku.ref-test-module.path system property and ensure you have run ./gradlew expandRefTests"));
91+
"Unable to find the reference tests module. Try setting teku.ref-test-module.path system property"
92+
+ " and ensure you have run ./gradlew expandRefTests"));
8793
}
8894

8995
static <I, O> Function<I, O> unchecked(final ExceptionThrowingFunction<I, O> function) {

0 commit comments

Comments
 (0)