Skip to content

Commit

Permalink
Fix issue where aws-lite client instantiation failure leads to red he…
Browse files Browse the repository at this point in the history
…rring destructuring error

Fix missing credentials for CI tests
  • Loading branch information
ryanblock committed Jan 27, 2024
1 parent 0642dfd commit 7c3d9f7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/helpers/_dynamo.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ module.exports = function getDynamo (callback) {
port,
region: AWS_REGION || 'us-west-2'
},
function gotClient (err, { dynamodb }) {
function gotClient (err, client) {
if (err) callback(err)
else {
db = dynamodb
db = client.dynamodb
callback(null, db)
}
})
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/_get-ports.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ module.exports = function getPorts (callback) {
region: AWS_REGION || 'us-west-2',
}

aws(config, function gotClient (err, { ssm }) {
aws(config, function gotClient (err, client) {
if (err) callback(err)
else {
let { ssm } = client
let getParameter = util.callbackify(ssm.GetParameter)
getParameter({ Name }, function done (err, result) {
if (err) callback(err)
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/_get-table-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ module.exports = function getTableName (callback) {
}

function go (config) {
aws(config, function gotClient (err, { ssm }) {
aws(config, function gotClient (err, client) {
if (err) callback(err)
else {
let { ssm } = client
let getParameter = util.callbackify(ssm.GetParameter)
getParameter({ Name }, function done (err, result) {
// let ssm = new SSM(config)
Expand Down
4 changes: 4 additions & 0 deletions test/integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ test('env', t => {

test('Start sandbox', async t => {
t.plan(1)
process.env.AWS_ACCESS_KEY_ID = 'arc_dummy_access_key',
process.env.AWS_SECRET_ACCESS_KEY = 'arc_dummy_secret_key',
await sandbox.start({ cwd: __dirname, quiet: true })
t.pass('started')
})
Expand Down Expand Up @@ -254,6 +256,8 @@ test('paginate ten at a time', async t => {
// fin
test('shutdown sandbox', async t => {
t.plan(1)
delete process.env.AWS_ACCESS_KEY_ID
delete process.env.AWS_SECRET_ACCESS_KEY
await sandbox.end()
t.pass('done')
})
Expand Down
4 changes: 4 additions & 0 deletions test/namespace-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ let test = require('tape')

test('start sandbox', async t => {
t.plan(1)
process.env.AWS_ACCESS_KEY_ID = 'arc_dummy_access_key',
process.env.AWS_SECRET_ACCESS_KEY = 'arc_dummy_secret_key',
await sandbox.start({ quiet: true, cwd: __dirname })
t.pass('sandbox.start')
})
Expand All @@ -28,6 +30,8 @@ test('tables with similar namespacing', async t => {

test('shutdown sandbox', async t => {
t.plan(1)
delete process.env.AWS_ACCESS_KEY_ID
delete process.env.AWS_SECRET_ACCESS_KEY
await sandbox.end()
t.pass('sandbox.end')
})
Expand Down

0 comments on commit 7c3d9f7

Please sign in to comment.