Skip to content

Commit e4822c7

Browse files
committed
fix(test-suite): tighten release lock and kms rc compat
1 parent a63b9bd commit e4822c7

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

.github/workflows/test-suite-orchestrate-e2e-tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@ jobs:
6464
set -euo pipefail
6565
artifact_name="fhevm-base-lock-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
6666
lock_path="$RUNNER_TEMP/release-base-lock.json"
67+
profile_path="$RUNNER_TEMP/latest-supported.json"
6768
base_short_tag="${BASE_SHA:0:7}"
68-
git show "${BASE_SHA}:test-suite/fhevm/profiles/latest-supported.json" | BASE_SHORT_TAG="$base_short_tag" LOCK_PATH="$lock_path" python3 - <<'PY'
69+
git show "${BASE_SHA}:test-suite/fhevm/profiles/latest-supported.json" > "$profile_path"
70+
BASE_SHORT_TAG="$base_short_tag" LOCK_PATH="$lock_path" python3 - "$profile_path" <<'PY'
6971
import json
7072
import os
73+
import sys
7174
72-
bundle = json.load(__import__("sys").stdin)
75+
with open(sys.argv[1], encoding="utf8") as fh:
76+
bundle = json.load(fh)
7377
base_short_tag = os.environ["BASE_SHORT_TAG"]
7478
bundle["target"] = "latest-supported"
7579
bundle["lockName"] = f"release-base-{base_short_tag}.json"

test-suite/fhevm/src/compat.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
MODERN_RELAYER_IMAGE_REPOSITORY,
77
MODERN_RELAYER_MIGRATE_IMAGE_REPOSITORY,
88
compatPolicyForState,
9+
requiresLegacyKmsCoreConfig,
910
requiresLegacyRelayerUrl,
1011
validateBundleCompatibility,
1112
} from "./compat/compat";
@@ -71,6 +72,19 @@ describe("compat", () => {
7172
).toBe(true);
7273
});
7374

75+
test("treats kms-core v0.13.10 prereleases as modern config schema", () => {
76+
expect(
77+
requiresLegacyKmsCoreConfig({
78+
versions: {
79+
target: "sha",
80+
lockName: "sha.json",
81+
env: { CORE_VERSION: "v0.13.10-rc.3" } as Record<string, string>,
82+
sources: [],
83+
},
84+
}),
85+
).toBe(false);
86+
});
87+
7488
test("renders legacy pauser flags for old contract tags", () => {
7589
const policy = compatPolicyForState({
7690
versions: {

test-suite/fhevm/src/compat/compat.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ const parseCompatVersion = (version: string) => {
111111

112112
const usesModernRelayerRepository = (version: string) => !parseCompatVersion(version);
113113

114+
const sameCompatBase = (version: string, target: CompatSemver) => {
115+
const parsed = parseCompatVersion(version);
116+
return !!parsed && parsed.parts.every((part, index) => part === target[index]);
117+
};
118+
114119
export const relayerImageRepository = (version: string) =>
115120
usesModernRelayerRepository(version) ? MODERN_RELAYER_IMAGE_REPOSITORY : LEGACY_RELAYER_IMAGE_REPOSITORY;
116121

@@ -159,7 +164,8 @@ export const requiresLegacyRelayerReadinessConfig = (state: Pick<CompatState, "v
159164

160165
/** Detects when kms-core still expects the legacy config schema. */
161166
export const requiresLegacyKmsCoreConfig = (state: Pick<CompatState, "versions">) =>
162-
versionLt(state.versions.env.CORE_VERSION ?? "", [0, 13, 10]);
167+
versionLt(state.versions.env.CORE_VERSION ?? "", [0, 13, 10]) &&
168+
!sameCompatBase(state.versions.env.CORE_VERSION ?? "", [0, 13, 10]);
163169

164170
/** Detects when test-suite should use the legacy relayer base URL. */
165171
export const requiresLegacyRelayerUrl = (state: Pick<CompatState, "versions">) =>

0 commit comments

Comments
 (0)