-
Notifications
You must be signed in to change notification settings - Fork 548
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(client-s3): add cross platform integration test #1296
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1296 +/- ##
==========================================
+ Coverage 73.17% 77.49% +4.31%
==========================================
Files 290 286 -4
Lines 12792 11899 -893
Branches 2936 2600 -336
==========================================
- Hits 9361 9221 -140
+ Misses 3431 2678 -753
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting AccessDenied
errors when trying to run locally.
console output
$ pwd
/home/trivikr/workspace/aws-sdk-js-v3/clients/client-s3
$ AWS_SMOKE_TEST_REGION=us-west-2 yarn test:e2e
yarn run v1.22.4
$ mocha **/cjs/**/*.ispec.js && karma start karma.conf.js
@aws-sdk/client-s3
PutObject
1) should succeed with Node.js readable stream body
2) "after all" hook for "should succeed with Node.js readable stream body"
ListObjects
3) should succeed with valid bucket
✓ should throw with invalid bucket
MultipartUpload
4) should successfully create, upload list and complete
5) "after each" hook for "should successfully create, upload list and complete"
1 passing (106ms)
5 failing
1) @aws-sdk/client-s3
PutObject
should succeed with Node.js readable stream body:
AccessDenied: Access Denied
at deserializeAws_restXmlPutObjectCommandError (dist/cjs/protocols/Aws_restXml.js:6368:41)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
2) @aws-sdk/client-s3
PutObject
"after all" hook for "should succeed with Node.js readable stream body":
AccessDenied: Access Denied
at deserializeAws_restXmlDeleteObjectCommandError (dist/cjs/protocols/Aws_restXml.js:4000:41)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
3) @aws-sdk/client-s3
ListObjects
should succeed with valid bucket:
AccessDenied: Access Denied
at deserializeAws_restXmlListObjectsCommandError (dist/cjs/protocols/Aws_restXml.js:5623:41)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
4) @aws-sdk/client-s3
MultipartUpload
should successfully create, upload list and complete:
AccessDenied: Access Denied
at deserializeAws_restXmlCreateMultipartUploadCommandError (dist/cjs/protocols/Aws_restXml.js:3675:41)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
5) @aws-sdk/client-s3
MultipartUpload
"after each" hook for "should successfully create, upload list and complete":
AccessDenied: Access Denied
at deserializeAws_restXmlDeleteObjectCommandError (dist/cjs/protocols/Aws_restXml.js:4000:41)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
error Command failed with exit code 5.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Verified that integrations tests are working with my default profile
console output
$ pwd
/home/trivikr/workspace/aws-sdk-js-v3
$ yarn test:integration-legacy --tags @acm
yarn run v1.22.4
$ cucumber-js --fail-fast --tags @acm
.........
2 scenarios (2 passed)
5 steps (5 passed)
0m00.138s
Done in 2.52s.
@trivikr Sorry for not being clear on resources needed for the testing evironment. As mentioned here, this smoke test requires an existing bucket:
This is required because programmably This is a quirk of S3, most other serivices don't have this problem, they simply support or not support CORS for all the operations. But S3 just doesn't support CORS for only the bucket operations. |
Co-authored-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com>
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. |
This is an sample to add cross-platform integration test to a client.
The package
@aws-sdk/karma-credential-loader
is a preprocessor used by karma browser integration test. But it does is that it will call the Node.js-specific region and credential provider to load value from the environment. Then define these varibles(defaultRegion
,credentials
,isBrowsers
) in the bundled artifact generated by karma.Under S3 client folder, users can run the bellow command to run the same integration test suite in Node.js, chrome, and Firefox.
AWS_SMOKE_TEST_REGION=us-west-2 yarn test:e2e
All the integration tests must have extension
XX.ispec.ts
. The test suites should havedefaultRegion
,credentials
,isBrowsers
vaiables defined in browser tests. In Node.js test, these parameters need to be initialized before using. Because Node.js client itself can load credentials and region from the environment, the test can just initialize them toundefined
.Console output
CodeBuild validation on commit aa4977c: login and review the console
To run the S3 integ test, the user need to:
aws-sdk-unit-test
).TODO:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.