-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: simplify endpoint integration tests #6373
Merged
trivikr
merged 15 commits into
aws:main
from
trivikr:refactor-endpoints-integration-test
Aug 12, 2024
Merged
test: simplify endpoint integration tests #6373
trivikr
merged 15 commits into
aws:main
from
trivikr:refactor-endpoints-integration-test
Aug 12, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trivikr
force-pushed
the
refactor-endpoints-integration-test
branch
from
August 9, 2024 19:25
4bb89fa
to
c366769
Compare
Test Suites: 1 failed, 1 total Tests: 22 failed, 124 skipped, 14526 passed, 14672 total Snapshots: 0 total Time: 61.488 s
Following tests are failing after passing Command from namespace $ yarn jest -c tests/endpoints-2.0/jest.config.js tests/endpoints-2.0/endpoints-integration.spec.ts
...
● client list › client-s3-control endpoint test cases › Vanilla outposts without ARN region + access point ARN@us-west-2
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts.us-west-2.amazonaws.com/"
Received string: "https://123456789012.s3-control.us-west-2.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › Vanilla outposts with ARN region + access point ARN@us-west-2
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts.us-east-1.amazonaws.com/"
Received string: "https://123456789012.s3-control.us-west-2.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › accept an access point ARN@us-west-2
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts.us-west-2.amazonaws.com/"
Received string: "https://123456789012.s3-control.us-west-2.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › vanilla outposts china@cn-north-1
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts.cn-north-1.amazonaws.com.cn/"
Received string: "https://123456789012.s3-control.cn-north-1.amazonaws.com.cn/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › gov region@us-west-2
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts.us-west-2.amazonaws.com/"
Received string: "https://123456789012.s3-control.us-west-2.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › gov cloud with fips@us-west-2
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts-fips.us-west-2.amazonaws.com/"
Received string: "https://123456789012.s3-control-fips.us-west-2.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › govcloud with fips + arn region@us-gov-west-1
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts-fips.us-gov-east-1.amazonaws.com/"
Received string: "https://123456789012.s3-control-fips.us-gov-west-1.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › gov region@cn-north-1
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts.cn-north-1.amazonaws.com.cn/"
Received string: "https://123456789012.s3-control.cn-north-1.amazonaws.com.cn/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › gov cloud with fips@cn-north-1
EndpointError: Partition does not support FIPS
85 | params
86 | )) as EndpointParams;
> 87 | const observed = resolveEndpoint(ruleSet, { endpointParams });
| ^
88 | assertEndpointResolvedCorrectly(endpoint, observed);
89 | }
90 | } else {
at evaluateErrorRule (../../node_modules/@smithy/util-endpoints/dist-cjs/index.js:401:9)
at evaluateRules (../../node_modules/@smithy/util-endpoints/dist-cjs/index.js:431:7)
at evaluateTreeRule (../../node_modules/@smithy/util-endpoints/dist-cjs/index.js:416:10)
at evaluateRules (../../node_modules/@smithy/util-endpoints/dist-cjs/index.js:433:35)
at evaluateTreeRule (../../node_modules/@smithy/util-endpoints/dist-cjs/index.js:416:10)
at evaluateRules (../../node_modules/@smithy/util-endpoints/dist-cjs/index.js:433:35)
at evaluateTreeRule (../../node_modules/@smithy/util-endpoints/dist-cjs/index.js:416:10)
at evaluateRules (../../node_modules/@smithy/util-endpoints/dist-cjs/index.js:433:35)
at resolveEndpoint (../../node_modules/@smithy/util-endpoints/dist-cjs/index.js:462:20)
at Object.<anonymous> (endpoints-integration.spec.ts:87:47)
● client list › client-s3-control endpoint test cases › govcloud with fips + arn region@us-gov-west-1
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts-fips.us-gov-east-1.amazonaws.com/"
Received string: "https://123456789012.s3-control-fips.us-gov-west-1.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › gov region@af-south-1
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts.af-south-1.amazonaws.com/"
Received string: "https://123456789012.s3-control.af-south-1.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › gov cloud with fips@af-south-1
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts-fips.af-south-1.amazonaws.com/"
Received string: "https://123456789012.s3-control-fips.af-south-1.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › govcloud with fips + arn region@us-gov-west-1
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts-fips.us-gov-east-1.amazonaws.com/"
Received string: "https://123456789012.s3-control-fips.us-gov-west-1.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › outpost access points support dualstack@us-west-2
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts.us-west-2.api.aws/"
Received string: "https://123456789012.s3-control.dualstack.us-west-2.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › outpost access points support dualstack@af-south-1
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts.af-south-1.api.aws/"
Received string: "https://123456789012.s3-control.dualstack.af-south-1.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › outpost access points support fips + dualstack@af-south-1
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts-fips.af-south-1.api.aws/"
Received string: "https://123456789012.s3-control-fips.dualstack.af-south-1.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › Account ID set inline and in ARN but they both match@us-west-2
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts.us-west-2.amazonaws.com/"
Received string: "https://123456789012.s3-control.us-west-2.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › Account ID set inline and in ARN and they do not match@us-west-2
expect(received).toBeUndefined()
Received: "https://999999999999.s3-control.us-west-2.amazonaws.com/"
107 | const observedError = await (async () => defaultEndpointResolver(endpointParams as any))().catch(pass);
108 | expect(observedError).not.toBeUndefined();
> 109 | expect(observedError?.url).toBeUndefined();
| ^
110 | // expect(normalizeQuotes(String(observedError))).toContain(normalizeQuotes(error));
111 | }
112 | } else {
at Object.<anonymous> (endpoints-integration.spec.ts:109:42)
● client list › client-s3-control endpoint test cases › endpoint url with s3-outposts@us-west-2
expect(received).toContain(expected) // indexOf
Expected substring: "https://beta.example.com/"
Received string: "https://123456789012.beta.example.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › Outpost Accesspoint ARN with arn region and client region mismatch with UseArnRegion=false
expect(received).toBeUndefined()
Received: "https://123456789012.s3-control.us-west-2.amazonaws.com/"
107 | const observedError = await (async () => defaultEndpointResolver(endpointParams as any))().catch(pass);
108 | expect(observedError).not.toBeUndefined();
> 109 | expect(observedError?.url).toBeUndefined();
| ^
110 | // expect(normalizeQuotes(String(observedError))).toContain(normalizeQuotes(error));
111 | }
112 | } else {
at Object.<anonymous> (endpoints-integration.spec.ts:109:42)
● client list › client-s3-control endpoint test cases › Accesspoint ARN with region mismatch and UseArnRegion unset
expect(received).toContain(expected) // indexOf
Expected substring: "https://s3-outposts.us-east-1.amazonaws.com/"
Received string: "https://123456789012.s3-control.us-west-2.amazonaws.com/"
129 | const { authSchemes } = properties || {};
130 | if (url) {
> 131 | expect(observed.url.href).toContain(new URL(url).href);
| ^
132 | expect(Math.abs(observed.url.href.length - url.length)).toBeLessThan(2);
133 | }
134 | if (headers) {
at assertEndpointResolvedCorrectly (endpoints-integration.spec.ts:131:31)
at Object.<anonymous> (endpoints-integration.spec.ts:88:15)
● client list › client-s3-control endpoint test cases › Accesspoint ARN with partition mismatch and UseArnRegion=true
expect(received).toBeUndefined()
Received: "https://123456789012.s3-control.us-west-2.amazonaws.com/"
107 | const observedError = await (async () => defaultEndpointResolver(endpointParams as any))().catch(pass);
108 | expect(observedError).not.toBeUndefined();
> 109 | expect(observedError?.url).toBeUndefined();
| ^
110 | // expect(normalizeQuotes(String(observedError))).toContain(normalizeQuotes(error));
111 | }
112 | } else {
at Object.<anonymous> (endpoints-integration.spec.ts:109:42)
Test Suites: 1 failed, 1 total
Tests: 22 failed, 124 skipped, 14526 passed, 14672 total
Snapshots: 0 total
Time: 28.648 s |
trivikr
force-pushed
the
refactor-endpoints-integration-test
branch
from
August 9, 2024 22:11
038e03f
to
6e5b22d
Compare
This was referenced Aug 12, 2024
The fix in #6376 was verified $ yarn jest -c tests/endpoints-2.0/jest.config.js tests/endpoints-2.0/endpoints-integration.spec.ts
...
Test Suites: 1 passed, 1 total
Tests: 124 skipped, 14548 passed, 14672 total
Snapshots: 0 total
Time: 23.957 s, estimated 29 s |
kuhe
reviewed
Aug 12, 2024
kuhe
approved these changes
Aug 12, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Internal JS-5234
Description
Simplifies endpoint integration tests as follows:
Testing
Before
After
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.