This is an automated email from the ASF dual-hosted git repository.
tballison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/main by this push:
new e6bc8beb39 TIKA-4933: build the .run-info test fixture at test time;
the source release excludes dot-directories (#3259)
e6bc8beb39 is described below
commit e6bc8beb39245607dccb98ecee9d3a2c051db103
Author: Tim Allison <[email protected]>
AuthorDate: Sat Sep 26 08:35:55 2026 -0400
TIKA-4933: build the .run-info test fixture at test time; the source
release excludes dot-directories (#3259)
---
.github/workflows/main-jdk17-build.yml | 6 +++
.../tika/eval/app/ComparerOneSidedLedgerTest.java | 4 +-
.../tika/eval/app/ProfilerDiscoveryTest.java | 2 +-
.../org/apache/tika/eval/app/RunInfoFixture.java | 47 ++++++++++++++++++++++
.../extractsB/.run-info/crashes-run-b1.jsonl | 3 --
.../extractsB/.run-info/run-info-run-b1.json | 4 --
6 files changed, 56 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/main-jdk17-build.yml
b/.github/workflows/main-jdk17-build.yml
index 8c1b5f58e5..ffb7f16445 100644
--- a/.github/workflows/main-jdk17-build.yml
+++ b/.github/workflows/main-jdk17-build.yml
@@ -78,6 +78,12 @@ jobs:
# rat runs in its own SERIAL invocation: apache-rat-plugin 0.18 is not
# thread-safe (ConcurrentModificationException / corrupted counters under
# -T), so it must never share a -T1C command line.
+ - name: No dot-directories under src/*/resources (the source release
excludes **/.*/**)
+ run: |
+ if git ls-files -- '*/src/main/resources/*' '*/src/test/resources/*'
| grep -E '/\.[^/]+/'; then
+ echo "::error::dot-directory fixtures are dropped from the source
release by assembly.xml; build them at test time instead"
+ exit 1
+ fi
- name: License check (apache-rat, serial)
run: |
mvn apache-rat:check -Pci \
diff --git
a/tika-eval/tika-eval-app/src/test/java/org/apache/tika/eval/app/ComparerOneSidedLedgerTest.java
b/tika-eval/tika-eval-app/src/test/java/org/apache/tika/eval/app/ComparerOneSidedLedgerTest.java
index 33507bdf2f..96e581787e 100644
---
a/tika-eval/tika-eval-app/src/test/java/org/apache/tika/eval/app/ComparerOneSidedLedgerTest.java
+++
b/tika-eval/tika-eval-app/src/test/java/org/apache/tika/eval/app/ComparerOneSidedLedgerTest.java
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
import org.apache.tika.eval.app.db.H2Util;
-/** A 3.x baseline has no jsonl ledger; B's is discovered from
extractsB/.run-info without flags. */
+/** A 3.x baseline has no jsonl ledger; B's is discovered from {@code
<extractsB>/.run-info} without flags. */
public class ComparerOneSidedLedgerTest {
@Test
@@ -46,7 +46,7 @@ public class ComparerOneSidedLedgerTest {
ExtractComparerRunner.main(new String[]{
"-i", testDirs.resolve("raw_input").toString(),
"-a", testDirs.resolve("extractsA").toString(),
- "-b", testDirs.resolve("extractsB").toString(),
+ "-b", RunInfoFixture.extractsBWithRunInfo(dir).toString(),
"-d", db.toAbsolutePath().toString(),
"-r", "-rd", reports.toString()
});
diff --git
a/tika-eval/tika-eval-app/src/test/java/org/apache/tika/eval/app/ProfilerDiscoveryTest.java
b/tika-eval/tika-eval-app/src/test/java/org/apache/tika/eval/app/ProfilerDiscoveryTest.java
index b149e21ca2..0a03edb852 100644
---
a/tika-eval/tika-eval-app/src/test/java/org/apache/tika/eval/app/ProfilerDiscoveryTest.java
+++
b/tika-eval/tika-eval-app/src/test/java/org/apache/tika/eval/app/ProfilerDiscoveryTest.java
@@ -41,7 +41,7 @@ public class ProfilerDiscoveryTest {
@Test
public void testDiscoversRunInfoAndSkipsItInCrawl(@TempDir Path tmp)
throws Exception {
Path db = tmp.resolve("db");
- ExtractProfileRunner.main(new String[]{"-e",
testDirs().resolve("extractsB").toString(), "-d",
db.toAbsolutePath().toString()});
+ ExtractProfileRunner.main(new String[]{"-e",
RunInfoFixture.extractsBWithRunInfo(tmp).toString(), "-d",
db.toAbsolutePath().toString()});
try (Connection c = new H2Util(db).getConnection(); Statement st =
c.createStatement()) {
assertEquals("run-b1", one(st, "select run_value from run_info
where run_key='batch.run.id'"));
assertEquals("EMIT_SUCCESS", one(st, "select pipes_status from
containers where file_path='file1.pdf'"));
diff --git
a/tika-eval/tika-eval-app/src/test/java/org/apache/tika/eval/app/RunInfoFixture.java
b/tika-eval/tika-eval-app/src/test/java/org/apache/tika/eval/app/RunInfoFixture.java
new file mode 100644
index 0000000000..636c4d882b
--- /dev/null
+++
b/tika-eval/tika-eval-app/src/test/java/org/apache/tika/eval/app/RunInfoFixture.java
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+package org.apache.tika.eval.app;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+
+import org.apache.commons.io.FileUtils;
+
+/**
+ * Builds an extracts dir with a {@code .run-info/} beside it at test time.
The source release
+ * excludes every dot-directory ({@code assembly.xml}: {@code
**/.*/**}), so this fixture
+ * cannot be stored in {@code src/test/resources}; it is assembled from {@code
pipes-reports/}.
+ */
+final class RunInfoFixture {
+
+ private RunInfoFixture() {
+ }
+
+ /** A copy of {@code test-dirs/extractsB} with run B's run-info json and
crash ledger discoverable. */
+ static Path extractsBWithRunInfo(Path tmp) throws Exception {
+ Path testDirs =
Paths.get(RunInfoFixture.class.getResource("/test-dirs").toURI());
+ Path extracts = tmp.resolve("extractsB");
+ FileUtils.copyDirectory(testDirs.resolve("extractsB").toFile(),
extracts.toFile());
+ Path runInfo =
Files.createDirectories(extracts.resolve(RunInfo.RUN_INFO_DIR));
+ for (String name : List.of("run-info-run-b1.json",
"crashes-run-b1.jsonl")) {
+ Files.copy(testDirs.resolve("pipes-reports").resolve(name),
runInfo.resolve(name));
+ }
+ return extracts;
+ }
+}
diff --git
a/tika-eval/tika-eval-app/src/test/resources/test-dirs/extractsB/.run-info/crashes-run-b1.jsonl
b/tika-eval/tika-eval-app/src/test/resources/test-dirs/extractsB/.run-info/crashes-run-b1.jsonl
deleted file mode 100644
index ee8b02a240..0000000000
---
a/tika-eval/tika-eval-app/src/test/resources/test-dirs/extractsB/.run-info/crashes-run-b1.jsonl
+++ /dev/null
@@ -1,3 +0,0 @@
-{"id":"file1.pdf","status":"EMIT_SUCCESS","category":"SUCCESS","message":null,"elapsedMs":10,"timestamp":"2026-08-27T11:00:00Z"}
-{"id":"sub\\file9_noextract.txt","status":"TIMEOUT","category":"PROCESS_CRASH","message":"timed
out","elapsedMs":60000,"timestamp":"2026-08-27T11:00:01Z"}
-{"id":"file9_noextract.txt","status":"TIMEOUT","category":"PROCESS_CRASH","message":"timed
out after 60000ms","elapsedMs":60000,"timestamp":"2026-08-27T11:01:01Z"}
diff --git
a/tika-eval/tika-eval-app/src/test/resources/test-dirs/extractsB/.run-info/run-info-run-b1.json
b/tika-eval/tika-eval-app/src/test/resources/test-dirs/extractsB/.run-info/run-info-run-b1.json
deleted file mode 100644
index de404acc1b..0000000000
---
a/tika-eval/tika-eval-app/src/test/resources/test-dirs/extractsB/.run-info/run-info-run-b1.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "run": {"id": "run-b1", "note": "candidate", "start":
"2026-08-27T10:59:00Z", "host": "box-b", "user": "tester"},
- "tika": {"app_path": "/opt/tika/tika-app-4.1.0-SNAPSHOT.jar", "app_sha256":
"def456", "version": "4.1.0-SNAPSHOT"}
-}