-
Notifications
You must be signed in to change notification settings - Fork 120
Integration test for large images and different file types #4608
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
base: main
Are you sure you want to change the base?
Conversation
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1", | ||
| "test": "jest", | ||
| "test:integration": "AWS_PROFILE=media-service NODE_OPTIONS='--experimental-vm-modules' jest --config jest.integration.config.ts", |
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.
See https://jestjs.io/docs/ecmascript-modules for why --experimental-vm-modules
(VSCode doesn't like me putting comments in JSON!)
Maybe there's another solution involving fiddling with the tsconfig or transpiling but I didn't want to go down that road
ellenmuller
left a comment
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.
Nice!
I've gone ahead and removed the images that were in the image-embedding-test bucket in the test-folder, because we don't need those anymore now that we can embed from localstack and test.
We are planning to implement resizing and TIFF-handling logic that will make all these tests pass.
First, we need to know exactly the requirements of Bedrock Cohere v3.
The AWS docs claim that the image can have a max size of 5 MB, but the tests prove that in actual fact that limit is 5 mebibytes (MiB), i.e. 5 * 1024 * 1024 = 5,242,880.
So PNGs and JPGs under the size limit currently work fine, but TIFFs of any size fail, as do PNGs and JPGs over the size limit.
how to test
Run
This will hit Bedrock for real