Skip to content

Commit ec28c27

Browse files
committed
test(functional): fips+dualstack endpoints
1 parent 749a483 commit ec28c27

File tree

7 files changed

+12062
-414
lines changed

7 files changed

+12062
-414
lines changed

tests/functional/endpoints/fips/index.spec.ts renamed to tests/functional/endpoints/fips-pseudo-region/index.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const getClientPackageName = (sdkId: string) =>
88
.map((word) => word.toLowerCase())
99
.join("-")}`;
1010

11-
describe("endpoints.fips", () => {
11+
// These tests should be removed when pseudo regions are deprecated.
12+
describe("endpoints.fips-pseudo-region", () => {
1213
for (const { sdkId, region, signingRegion, hostname } of testCases) {
1314
const clientPackageName = getClientPackageName(sdkId);
1415
it(`testing "${clientPackageName}" with region: ${region}`, async () => {

tests/functional/endpoints/fixtures.ts

Lines changed: 0 additions & 400 deletions
This file was deleted.
Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
import { join } from "path";
22

3-
import { KNOWN_REGIONS } from "./fixtures";
3+
import testCases from "./test_cases_supported.json";
44

5-
describe("hostname for know regions", () => {
6-
for (const region of Object.keys(KNOWN_REGIONS)) {
7-
describe(region, () => {
8-
for (const [service, expectedHostname] of Object.entries(KNOWN_REGIONS[region])) {
9-
it(`${service} should resolve to hostname ${expectedHostname}`, async () => {
10-
const { defaultRegionInfoProvider } = await import(
11-
join("..", "..", "..", "clients", `client-${service}`, "src", "endpoints")
12-
);
13-
const { hostname } = await defaultRegionInfoProvider(region);
14-
expect(hostname).toBe(expectedHostname);
15-
});
16-
}
5+
const getClientPackageName = (sdkId: string) =>
6+
`client-${sdkId
7+
.split(" ")
8+
.map((word) => word.toLowerCase())
9+
.join("-")}`;
10+
11+
describe("endpoints", () => {
12+
for (const { sdkId, region, useFipsEndpoint, useDualstackEndpoint, hostname } of testCases) {
13+
const clientPackageName = getClientPackageName(sdkId);
14+
it(`testing "${clientPackageName}" with region: ${region}`, async () => {
15+
const { defaultRegionInfoProvider } = await import(
16+
join("..", "..", "..", "clients", clientPackageName, "src", "endpoints")
17+
);
18+
const regionInfo = await defaultRegionInfoProvider(region, { useFipsEndpoint, useDualstackEndpoint });
19+
expect(regionInfo.hostname).toEqual(hostname);
1720
});
1821
}
1922
});

0 commit comments

Comments
 (0)