freshollie / jest-dynalite

Jest preset to run Dynalite (DynamoDB local) per test runner
https://www.npmjs.com/package/jest-dynalite
MIT License
151 stars 16 forks source link

CreateTables fail with @aws-sdk/client-dynamodb version 1.196.0 #86

Closed tomer-landesman closed 2 years ago

tomer-landesman commented 2 years ago

jest-dynalite version is 3.6.0

we tried to upgrade @aws-sdk/client-dynamodb to version 1.196.0 and hit a regression on createTables. it might be something with our configuration, but it work perfectly fine with older version.

the error we are getting is being thrown from @aws-sdk/util-endpoint which is a dependency for client-dynamodb. it states:

    at getEndpointUrl (/Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+util-endpoints@3.196.0/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/getEndpointUrl.js:18:11)
    at evaluateEndpointRule (/Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+util-endpoints@3.196.0/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateEndpointRule.js:26:50)
    at evaluateRules (/Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+util-endpoints@3.196.0/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateRules.js:11:89)
    at evaluateTreeRule (/Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+util-endpoints@3.196.0/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateTreeRule.js:12:46)
    at evaluateRules (/Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+util-endpoints@3.196.0/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateRules.js:20:81)
    at evaluateTreeRule (/Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+util-endpoints@3.196.0/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateTreeRule.js:12:46)
    at evaluateRules (/Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+util-endpoints@3.196.0/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateRules.js:20:81)
    at evaluateTreeRule (/Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+util-endpoints@3.196.0/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateTreeRule.js:12:46)
    at evaluateRules (/Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+util-endpoints@3.196.0/node_modules/@aws-sdk/util-endpoints/dist-cjs/utils/evaluateRules.js:20:81)
    at resolveEndpoint (/Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+util-endpoints@3.196.0/node_modules/@aws-sdk/util-endpoints/dist-cjs/resolveEndpoint.js:26:48)
    at Object.defaultEndpointResolver [as endpointProvider] (/Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+client-dynamodb@3.196.0/node_modules/@aws-sdk/client-dynamodb/dist-cjs/endpoint/endpointResolver.js:7:49)
    at getEndpointFromInstructions (/Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+middleware-endpoint@3.193.0/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/adaptors/getEndpointFromInstructions.js:10:35)
    at async /Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+middleware-endpoint@3.193.0/node_modules/@aws-sdk/middleware-endpoint/dist-cjs/endpointMiddleware.js:8:26
    at async /Users/tomer/Dev/env0/node_modules/.pnpm/@aws-sdk+middleware-logger@3.193.0/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:6:22
    at async Promise.all (index 0)
    at async /Users/tomer/Dev/env0/node_modules/.pnpm/jest-dynalite@3.6.0_57446b5d031a95bd8588aa35e409fc35/node_modules/jest-dynalite/dist/dynamodb/v3.js:64:5
 ELIFECYCLE  Test failed. See above for more details.

printing the endpoint, I see its an Object { ref: 'Endpoint' }, which is not expected by them

tomer-landesman commented 2 years ago

It was a bug with client-dynamodb, fixed in 3.197.0