Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .evergreen/connectivity-tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ docker run \
-e E2E_TESTS_FREE_TIER_HOST="${E2E_TESTS_FREE_TIER_HOST}" \
-e E2E_TESTS_ATLAS_USERNAME="${E2E_TESTS_ATLAS_USERNAME}" \
-e E2E_TESTS_ATLAS_PASSWORD="${E2E_TESTS_ATLAS_PASSWORD}" \
-e E2E_TESTS_ATLAS_X509_PEM="${E2E_TESTS_ATLAS_X509_PEM}" \
-e E2E_TESTS_ATLAS_X509_PEM_BASE64="${E2E_TESTS_ATLAS_X509_PEM_BASE64}" \
-e MONGODB_VERSION="${MONGODB_VERSION}" \
--add-host mongodb-kerberos-1.example.com:0.0.0.0 \
--add-host mongodb-kerberos-2.example.com:0.0.0.0 \
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ variables:
E2E_TESTS_FREE_TIER_HOST: ${e2e_tests_free_tier_host}
E2E_TESTS_ATLAS_USERNAME: ${e2e_tests_atlas_username}
E2E_TESTS_ATLAS_PASSWORD: ${e2e_tests_atlas_password}
E2E_TESTS_ATLAS_X509_PEM: ${e2e_tests_atlas_x509_pem}
E2E_TESTS_ATLAS_X509_PEM_BASE64: ${e2e_tests_atlas_x509_pem_base64}
E2E_TESTS_ATLAS_IAM_ACCESS_KEY_ID: ${e2e_tests_atlas_iam_aws_access_key_id}
E2E_TESTS_ATLAS_IAM_SECRET_ACCESS_KEY: ${e2e_tests_atlas_iam_aws_secret_access_key}
E2E_TESTS_ATLAS_IAM_TEMP_ROLE_ARN: ${e2e_tests_atlas_iam_temp_role_arn}
Expand Down
8 changes: 6 additions & 2 deletions packages/compass-e2e-tests/tests/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function hasAtlasEnvironmentVariables(): boolean {
'E2E_TESTS_FREE_TIER_HOST',
'E2E_TESTS_ATLAS_USERNAME',
'E2E_TESTS_ATLAS_PASSWORD',
'E2E_TESTS_ATLAS_X509_PEM',
'E2E_TESTS_ATLAS_X509_PEM_BASE64',
'E2E_TESTS_ATLAS_IAM_ACCESS_KEY_ID',
'E2E_TESTS_ATLAS_IAM_SECRET_ACCESS_KEY',
'E2E_TESTS_ATLAS_IAM_TEMP_ROLE_ARN',
Expand Down Expand Up @@ -724,7 +724,11 @@ describe('Connection form', function () {
try {
tempdir = await fs.mkdtemp(path.join(os.tmpdir(), 'connect-tests-'));
const certPath = path.join(tempdir, 'x509.pem');
await fs.writeFile(certPath, process.env.E2E_TESTS_ATLAS_X509_PEM ?? '');
await fs.writeFile(
certPath,
process.env.E2E_TESTS_ATLAS_X509_PEM_BASE64 ?? '',
'base64'
);

const atlasConnectionOptions: ConnectFormState = {
hosts: [process.env.E2E_TESTS_ATLAS_HOST ?? ''],
Expand Down
13 changes: 10 additions & 3 deletions packages/data-service/src/connect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const {
E2E_TESTS_SERVERLESS_HOST,
E2E_TESTS_FREE_TIER_HOST,
E2E_TESTS_ANALYTICS_NODE_HOST,
E2E_TESTS_ATLAS_X509_PEM,
E2E_TESTS_ATLAS_X509_PEM_BASE64,
} = process.env;

const buildConnectionString = (
Expand Down Expand Up @@ -204,15 +204,22 @@ describe('connect', function () {
});

it('connects to atlas with X509', async function () {
if (!IS_CI && !(E2E_TESTS_ATLAS_HOST || E2E_TESTS_ATLAS_X509_PEM)) {
if (
!IS_CI &&
!(E2E_TESTS_ATLAS_HOST || E2E_TESTS_ATLAS_X509_PEM_BASE64)
) {
return this.skip();
}

let tempdir;
try {
tempdir = await fs.mkdtemp(path.join(os.tmpdir(), 'connect-tests-'));
const certPath = path.join(tempdir, 'x509.pem');
await fs.writeFile(certPath, E2E_TESTS_ATLAS_X509_PEM);
await fs.writeFile(
certPath,
process.env.E2E_TESTS_ATLAS_X509_PEM_BASE64 ?? '',
'base64'
);

const url = new ConnectionStringUrl(
`mongodb+srv://${E2E_TESTS_ATLAS_HOST || ''}/admin`
Expand Down
Loading