Skip to content

Commit 5d52c16

Browse files
jeffreyameyerclaude
andcommitted
Pin smoke test to the 0.2.0-stable API surface
The smoke test's job is "downstream Ant/Ivy consumers can pick up the published artefact" — that goal is met by exercising the parser, types, and bounds methods that have been on Maven Central since the first release. Drop the EdtfFormatter call from Smoke.java because that class only ships in 0.3.0+; with the previous wiring the daily workflow would fail to compile against the currently-published 0.2.0 jar with "package io.github.openhistoricalmap.edtf.format does not exist". The interval upper-endpoint type is now exercised instead. build.xml's substring assertions are tightened: instead of looking for "May 2020" (formatter output) they now look for the canonical "2020-05-15", the EdtfType "DATE", and the "2020/.." round-trip, all of which the 0.2.0 API produces. README.md adds a sentence explaining the version-tracking choice. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 37ea4f6 commit 5d52c16

3 files changed

Lines changed: 21 additions & 18 deletions

File tree

smoke/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ that:
1919
`io.github.openhistoricalmap:edtf:${edtf.version}` from Maven
2020
Central into `lib/`.
2121
2. `javac` compiles `src/Smoke.java`, which calls
22-
`Edtf.parse("2020-05-15")` and prints the round-tripped EDTF
23-
string and the lower bound.
24-
3. `java` runs the compiled class and the script asserts the
25-
output matches expected values; any deviation exits non-zero.
22+
`Edtf.parse("2020-05-15")` and a `2020/..` open-upper interval.
23+
3. `java` runs the compiled class and the script asserts on the
24+
captured stdout; any deviation exits non-zero.
25+
26+
The smoke source uses only API that has been stable since 0.2.0
27+
(the first published release). The daily workflow therefore
28+
exercises whichever version is currently on Maven Central without
29+
needing to be in lockstep with new feature releases.
2630

2731
## Prerequisites
2832

smoke/build.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@
5656

5757
<condition property="smoke.passed">
5858
<and>
59-
<contains string="${smoke.stdout}" substring="2020-05-15"/>
60-
<contains string="${smoke.stdout}" substring="May 2020"/>
59+
<contains string="${smoke.stdout}" substring="canonical: 2020-05-15"/>
60+
<contains string="${smoke.stdout}" substring="type: DATE"/>
61+
<contains string="${smoke.stdout}" substring="interval canonical: 2020/.."/>
6162
</and>
6263
</condition>
6364
<fail unless="smoke.passed"

smoke/src/Smoke.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
import io.github.openhistoricalmap.edtf.Edtf;
22
import io.github.openhistoricalmap.edtf.EdtfTemporal;
3-
import io.github.openhistoricalmap.edtf.format.EdtfFormatter;
4-
import java.util.Locale;
53

64
/**
75
* Smoke test asserting that the published edtf jar is usable from
8-
* a vanilla Ant + Ivy classpath. Prints two lines, both of which are
9-
* checked by build.xml's `test` target:
10-
* 1. The canonical round-tripped EDTF string.
11-
* 2. The English-localised formatter output.
6+
* a vanilla Ant + Ivy classpath. Uses only the API that has been
7+
* stable since the first published release (0.2.0), so the daily
8+
* smoke workflow exercises whichever version is on Maven Central
9+
* without coupling to features that may not yet be released.
10+
*
11+
* Prints lines that build.xml's `test` target checks for substrings.
1212
*/
1313
public class Smoke {
1414
public static void main(String[] args) {
1515
String input = "2020-05-15";
1616
EdtfTemporal t = Edtf.parse(input);
17-
1817
System.out.println("canonical: " + t.toEdtfString());
19-
System.out.println("localised: " + EdtfFormatter.forLocale(Locale.US).format(t));
18+
System.out.println("type: " + t.type());
19+
System.out.println("level: " + t.level());
2020
System.out.println("min: " + t.min());
2121
System.out.println("max: " + t.max());
22-
System.out.println("type: " + t.type());
2322

24-
// A second exercise: an open-ended interval with the formatter.
23+
// Cover an interval too.
2524
EdtfTemporal i = Edtf.parse("2020/..");
2625
System.out.println("interval canonical: " + i.toEdtfString());
27-
System.out.println("interval localised: "
28-
+ EdtfFormatter.forLocale(Locale.US).format(i));
26+
System.out.println("interval upper-open: " + i.upper().getClass().getSimpleName());
2927
}
3028
}

0 commit comments

Comments
 (0)