Skip to content

Commit

Permalink
test: what is even going on
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Oct 31, 2024
1 parent d7f3a9d commit d560239
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/delete-stale-changesets.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { ListChangeSetsCommand, DeleteChangeSetCommand } = require("../../clients/client-cloudformation");
const { ListChangeSetsCommand, DeleteChangeSetCommand } = require("@aws-sdk/client-cloudformation");

exports.deleteStaleChangesets = async (client, stackName) => {
const changesets = await client.send(
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/ensure-test-stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
waitUntilStackCreateComplete,
DescribeChangeSetCommand,
DeleteChangeSetCommand,
} = require("../../clients/client-cloudformation");
} = require("@aws-sdk/client-cloudformation");

/**
* Deploy the integration test stack if it does not exist. Update the
Expand Down
25 changes: 13 additions & 12 deletions tests/e2e/get-integ-test-resources.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
const { readFileSync } = require("fs");
const { join } = require("path");
const { STSClient, GetCallerIdentityCommand } = require("../../clients/client-sts");
const { CloudFormationClient, DescribeStackResourcesCommand } = require("../../clients/client-cloudformation");
const { S3ControlClient, ListMultiRegionAccessPointsCommand } = require("../../clients/client-s3-control");
const { STSClient, GetCallerIdentityCommand } = require("@aws-sdk/client-sts");
const { CloudFormationClient, DescribeStackResourcesCommand } = require("@aws-sdk/client-cloudformation");
const { S3ControlClient, ListMultiRegionAccessPointsCommand } = require("@aws-sdk/client-s3-control");
const { ensureTestStack } = require("./ensure-test-stack");
const { deleteStaleChangesets } = require("./delete-stale-changesets");
const { loadSharedConfigFiles } = require("@smithy/shared-ini-file-loader");
const { fromIni } = require("@aws-sdk/credential-providers");
const { createCredentialChain, fromIni, fromHttp } = require("@aws-sdk/credential-providers");

exports.getIntegTestResources = async () => {
const ini = await loadSharedConfigFiles();
if (ini.configFile["sdk-integ-test"] || ini.credentialsFile["sdk-integ-test"]) {
process.env.AWS_PROFILE = "sdk-integ-test";
const profileData = ini.configFile["sdk-integ-test"] ?? ini.credentialsFile["sdk-integ-test"];
if (profileData) {
console.log("Setting AWS_PROFILE=sdk-integ-test");
process.env.AWS_PROFILE = "sdk-integ-test";
if (profileData.role_arn) {
console.log(
`Setting AWS_CONTAINER_CREDENTIALS_RELATIVE_URI=${process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}`
);
process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = `/role-arn/${profileData.role_arn}`;
}
} else {
console.log("AWS_PROFILE is", process.env.AWS_PROFILE);
}

// TODO(debug)
console.log({
config: ini.configFile,
credentials: ini.credentialsFile,
});

const region = "us-west-2";
const cloudformation = new CloudFormationClient({
region,
Expand Down

0 comments on commit d560239

Please sign in to comment.