pr feedback

This commit is contained in:
Frostebite
2025-12-11 20:25:29 +00:00
parent 2d522680ec
commit 08ce820c87
9 changed files with 64 additions and 20 deletions
@@ -63,11 +63,36 @@ describe('Cloud Runner Sync Environments', () => {
value: x.ParameterValue,
};
});
// Apply the same localhost -> host.docker.internal replacement that the Docker provider does
// This ensures the test expectations match what's actually in the output
const endpointEnvironmentNames = new Set([
'AWS_S3_ENDPOINT',
'AWS_ENDPOINT',
'AWS_CLOUD_FORMATION_ENDPOINT',
'AWS_ECS_ENDPOINT',
'AWS_KINESIS_ENDPOINT',
'AWS_CLOUD_WATCH_LOGS_ENDPOINT',
'INPUT_AWSS3ENDPOINT',
'INPUT_AWSENDPOINT',
]);
const combined = [...environmentVariables, ...secrets]
.filter((element) => element.value !== undefined && element.value !== '' && typeof element.value !== 'function')
.map((x) => {
if (typeof x.value === `string`) {
x.value = x.value.replace(/\s+/g, '');
// Apply localhost -> host.docker.internal replacement for LocalStack endpoints
// when using local-docker or aws provider (which uses Docker)
if (
endpointEnvironmentNames.has(x.name) &&
(x.value.startsWith('http://localhost') || x.value.startsWith('http://127.0.0.1')) &&
(CloudRunnerOptions.providerStrategy === 'local-docker' || CloudRunnerOptions.providerStrategy === 'aws')
) {
x.value = x.value
.replace('http://localhost', 'http://host.docker.internal')
.replace('http://127.0.0.1', 'http://host.docker.internal');
}
}
return x;
@@ -33,6 +33,7 @@ describe('Cloud Runner Caching', () => {
cloudRunnerBranch: `cloud-runner-develop`,
cloudRunnerDebug: true,
};
// For AWS LocalStack tests, explicitly set provider strategy to 'aws'
// This ensures we use AWS LocalStack instead of defaulting to local-docker
if (process.env.AWS_S3_ENDPOINT && process.env.AWS_S3_ENDPOINT.includes('localhost')) {