Skip to content

Commit fef9eb3

Browse files
committed
Fix hosted deployment verification
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
1 parent 1eda114 commit fef9eb3

4 files changed

Lines changed: 39 additions & 21 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ candidate-only gate locally with `just review-release <registry-stack-tag>`;
201201
the normal contributor and CI gate remains `just review`.
202202

203203
For local eSignet testing, run `just up-esignet` instead of `just up`, then
204-
sign in through the portal with Elena's fixture `legacy_nid` and static OTP
205-
`111111`. This sign-in is the end-to-end check of the NIA
204+
sign in through the portal with Elena's fixture UIN `2300018263` and static
205+
OTP `111111`. This sign-in is the end-to-end check of the NIA
206206
`solmara-nia-userinfo` attribute-release profile and its rotating eSignet
207207
workload identity. Run `just smoke-esignet` for the public discovery checks.
208208

‎home/e2e/home.test.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { expect, test } from '@playwright/test';
22

33
const NAV_LINKS = ['Stories', 'Explorer', 'Purposes', 'Problem codes', 'Anatomy', 'Status'];
44

5+
const evaluationUrl = (configuredUrl: string | undefined, fallbackUrl: string) =>
6+
`${(configuredUrl ?? fallbackUrl).replace(/\/+$/, '')}/v1/evaluations`;
7+
58
test('landing renders with header nav and every section in order', async ({ page }) => {
69
const response = await page.goto('/');
710
expect(response?.headers()['content-security-policy']).toContain("default-src 'self'");
@@ -195,8 +198,12 @@ test('citizen story renders runnable curls for each authority call', async ({ pa
195198
const authorityRequests = result.locator('.request-list .peer-call');
196199
await expect(authorityRequests).toHaveCount(2);
197200
await expect(authorityRequests.getByRole('button', { name: 'Copy as curl' })).toHaveCount(2);
198-
await expect(authorityRequests.nth(0)).toContainText('http://localhost:4325/v1/evaluations');
199-
await expect(authorityRequests.nth(1)).toContainText('http://localhost:4326/v1/evaluations');
201+
await expect(authorityRequests.nth(0)).toContainText(
202+
evaluationUrl(process.env.CRA_NOTARY_URL, 'http://localhost:4325')
203+
);
204+
await expect(authorityRequests.nth(1)).toContainText(
205+
evaluationUrl(process.env.NIA_NOTARY_URL, 'http://localhost:4326')
206+
);
200207
await expect(result).not.toContainText('solmara://authority-notaries');
201208
});
202209

‎scripts/smoke-hosted.py‎

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,7 @@ def main(argv: list[str] | None = None) -> int:
9090
(
9191
"eSignet backend",
9292
lambda: run_command(
93-
[
94-
sys.executable,
95-
str(ROOT / "scripts" / "smoke-esignet.py"),
96-
"--relay-url",
97-
relay_url(targets, "SOLMARA_NIA_RELAY_URL"),
98-
"--esignet-url",
99-
targets.esignet_url,
100-
"--esignet-ui-url",
101-
targets.esignet_ui_url,
102-
],
93+
esignet_smoke_command(targets),
10394
env,
10495
cwd=ROOT,
10596
),
@@ -184,6 +175,17 @@ def main(argv: list[str] | None = None) -> int:
184175
return 0
185176

186177

178+
def esignet_smoke_command(targets: HostedTargets) -> list[str]:
179+
return [
180+
sys.executable,
181+
str(ROOT / "scripts" / "smoke-esignet.py"),
182+
"--esignet-url",
183+
targets.esignet_url,
184+
"--esignet-ui-url",
185+
targets.esignet_ui_url,
186+
]
187+
188+
187189
def parse_args(argv: list[str] | None) -> argparse.Namespace:
188190
parser = argparse.ArgumentParser(description=__doc__)
189191
parser.add_argument(
@@ -343,13 +345,6 @@ def hosted_env(
343345
return env
344346

345347

346-
def relay_url(targets: HostedTargets, env_name: str) -> str:
347-
for relay in targets.relays:
348-
if relay.env_name == env_name:
349-
return relay.base_url
350-
raise SmokeFailure(f"missing relay target for {env_name}")
351-
352-
353348
def check_public_routes(targets: HostedTargets, timeout: float) -> None:
354349
checks = [
355350
ServiceTarget("Visitor Center", targets.home_url, "/"),

‎scripts/test_smoke_hosted.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,22 @@ def test_normalize_argv_accepts_just_separator(self) -> None:
238238
)
239239
self.assertEqual(smoke_hosted.normalize_argv(["--browser"]), ["--browser"])
240240

241+
def test_esignet_smoke_uses_only_supported_discovery_arguments(self) -> None:
242+
targets = smoke_hosted.default_targets("solmara.registrystack.org")
243+
244+
command = smoke_hosted.esignet_smoke_command(targets)
245+
246+
self.assertNotIn("--relay-url", command)
247+
self.assertEqual(
248+
command[-4:],
249+
[
250+
"--esignet-url",
251+
"https://esignet.solmara.registrystack.org",
252+
"--esignet-ui-url",
253+
"https://esignet-ui.solmara.registrystack.org",
254+
],
255+
)
256+
241257
def test_home_demo_accepts_expected_scenario_flow(self) -> None:
242258
with StubServer(hosted_routes()) as server:
243259
smoke_hosted.check_home_demo(server.url, timeout=2)

0 commit comments

Comments
 (0)