Skip to content

Commit 94a1524

Browse files
SK-3037 fix module-split fallout in the test and spellcheck setup
Two failures on this PR, both from the common/v2/flowvault split rather than from the delete and tokenize work; each reproduces on the base branch. Tests: Dotenv resolves .env against the JVM working directory, which Surefire sets to the module basedir. CI writes one .env at the repo root, visible to every test when the build was a single module and to none of them since, so all five Dotenv-backed test classes failed - and because common builds first, the reactor died before v2 or flowvault ran. Copy the root .env into each module at process-test-resources. Repointing Surefire's working directory instead was tried and rejected: twelve BearerToken and SignedDataTokens tests locate fixtures by module-relative paths like ./src/test/resources/notJson.txt. Spellcheck: the generated-code ignore path was root-relative (src/main/java/com/skyflow/generated/**) so it stopped matching anything after the split, exposing Fern output - Okio, Googleprotobuf, Googlerpc and an "opertions" typo carried in from the API spec. Anchor it with **/ instead. Dictionary gains siom (the japicmp plugin groupId), vaultid and recordss (both existing identifiers in insert and detokenize code), and synthesise, deserialise and unmodelled, matching the serialise and normalise entries already there. Reworded "dedup" and replaced an opaque captured test value. cspell now reports 0 issues; common passes 172 tests where it previously failed at TokenTests. The three remaining ConnectionClientTests failures are unrelated and pre-existing - they need the real SKYFLOW_CREDENTIALS secret. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent cc148fb commit 94a1524

4 files changed

Lines changed: 52 additions & 7 deletions

File tree

.cspell.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,15 @@
9999
"detok",
100100
"qhdmceurtnlz",
101101
"ngrok",
102-
"obac"
102+
"obac",
103+
"siom",
104+
"vaultid",
105+
"recordss",
106+
"synthesise",
107+
"synthesised",
108+
"deserialise",
109+
"deserialised",
110+
"unmodelled"
103111
],
104112
"languageSettings": [
105113
{
@@ -119,7 +127,7 @@
119127
"**/target/**",
120128
"*.lock",
121129
"Rule/**",
122-
"src/main/java/com/skyflow/generated/**",
130+
"**/src/main/java/com/skyflow/generated/**",
123131
"**/*.ts",
124132
"**/processed-*",
125133
"samples/src/main/java/com/example/credentials.json",

flowvault/src/test/java/com/skyflow/utils/FlatTokenizeResponseTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private static BulkTokenizeRequestRecord byotRecord(Object value, String token,
4848

4949
private static final String LIVE_RESPONSE = "{\n"
5050
+ " \"response\": [\n"
51-
+ " { \"token\": \"\", \"value\": \"dasftrqsafasfav\", \"tokenGroupName\": null,\n"
51+
+ " { \"token\": \"\", \"value\": \"byot-input-value\", \"tokenGroupName\": null,\n"
5252
+ " \"error\": \"Invalid request. BYOT token should contain one token group.\", \"httpCode\": 400 },\n"
5353
+ " { \"token\": \"cc1179a3-e2be-404e-9a31-4f97f27bf406\", \"value\": {\"age\": 28, \"email\": \"ka@yahoo.com\"},\n"
5454
+ " \"tokenGroupName\": \"deterministic_string_tg\", \"error\": null, \"httpCode\": 200 },\n"
@@ -64,7 +64,7 @@ public void testLiveResponse_threeRowsFoldOntoTwoRecords() {
6464
objectValue.put("email", "ka@yahoo.com");
6565
objectValue.put("age", 28);
6666
List<BulkTokenizeRequestRecord> sent = Arrays.asList(
67-
byotRecord("dasftrqsafasfav", "550e8400-e29b-41d4-a716-446655440000",
67+
byotRecord("byot-input-value", "550e8400-e29b-41d4-a716-446655440000",
6868
"deterministic_string_tg", "non_deterministic"),
6969
record(objectValue, "deterministic_string_tg", "emailTokenGroup"));
7070

@@ -76,7 +76,7 @@ public void testLiveResponse_threeRowsFoldOntoTwoRecords() {
7676

7777
BulkTokenizeResponseRecord byot = result.getRecords().get(0);
7878
Assert.assertEquals(0, byot.getIndex());
79-
Assert.assertEquals("dasftrqsafasfav", byot.getValue());
79+
Assert.assertEquals("byot-input-value", byot.getValue());
8080
Assert.assertEquals(1, byot.getTokens().size());
8181
Assert.assertEquals("Invalid request. BYOT token should contain one token group.",
8282
byot.getTokens().get(0).getError());
@@ -100,7 +100,7 @@ public void testLiveResponse_summaryClassifiesByRecordNotByRow() {
100100
objectValue.put("email", "ka@yahoo.com");
101101
objectValue.put("age", 28);
102102
List<BulkTokenizeRequestRecord> sent = Arrays.asList(
103-
byotRecord("dasftrqsafasfav", "550e8400", "deterministic_string_tg", "non_deterministic"),
103+
byotRecord("byot-input-value", "550e8400", "deterministic_string_tg", "non_deterministic"),
104104
record(objectValue, "deterministic_string_tg", "emailTokenGroup"));
105105

106106
BulkTokenizeResponse formatted =

flowvault/src/test/java/com/skyflow/utils/UtilsTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ private static V1FlowDeleteTokenRequest deleteBatchOf(String... tokens) {
10581058
public void testFormatBulkDeleteTokensResponse_duplicateTokenRelaysEachRowVerbatim() {
10591059
// the same token sent twice: the API decides each position independently, and has been
10601060
// observed returning both 200,200 and 200,404 for the identical request. Whatever it says
1061-
// must reach the caller unchanged - no dedup, no normalising one row against the other.
1061+
// must reach the caller unchanged - no deduplication, no normalising one row against the other.
10621062
String token = "e5874be2-940a-4c74-9c08-dc6c1e8c6f9b";
10631063
String message = "DeleteToken failed. Token " + token + " is invalid. Specify a valid token.";
10641064
V1FlowDeleteTokenResponse response = V1FlowDeleteTokenResponse.builder()

pom.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,43 @@
145145
</execution>
146146
</executions>
147147
</plugin>
148+
<!--
149+
Tests read secrets through Dotenv, which resolves .env against the JVM's working
150+
directory - for Surefire that is the module's basedir. CI writes a single .env at
151+
the repo root, which every module could see before the build was split into
152+
common/v2/flowvault, and none can see since. Copy it into each module before tests
153+
run rather than moving Surefire's working directory, because other tests locate
154+
fixtures by module-relative paths such as ./src/test/resources/notJson.txt and would
155+
break if that moved. Silently does nothing when no root .env exists, which is the
156+
normal case for a local build.
157+
-->
158+
<plugin>
159+
<groupId>org.apache.maven.plugins</groupId>
160+
<artifactId>maven-resources-plugin</artifactId>
161+
<version>3.3.1</version>
162+
<executions>
163+
<execution>
164+
<id>copy-root-dotenv-for-tests</id>
165+
<phase>process-test-resources</phase>
166+
<goals>
167+
<goal>copy-resources</goal>
168+
</goals>
169+
<configuration>
170+
<outputDirectory>${project.basedir}</outputDirectory>
171+
<overwrite>true</overwrite>
172+
<resources>
173+
<resource>
174+
<directory>${maven.multiModuleProjectDirectory}</directory>
175+
<includes>
176+
<include>.env</include>
177+
</includes>
178+
<filtering>false</filtering>
179+
</resource>
180+
</resources>
181+
</configuration>
182+
</execution>
183+
</executions>
184+
</plugin>
148185
<plugin>
149186
<groupId>org.apache.maven.plugins</groupId>
150187
<artifactId>maven-surefire-plugin</artifactId>

0 commit comments

Comments
 (0)