Skip to content

Commit 1a43601

Browse files
authored
Add mongoDB Atlas support, fixes #2663 (#6251)
1 parent 4afcdf1 commit 1a43601

File tree

113 files changed

+7468
-3917
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+7468
-3917
lines changed

docker/integration-tests/integration-tests-mongo.yaml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,32 @@ services:
2626
links:
2727
- mongo
2828

29-
mongo:
30-
image: mongo:7
29+
mongo-atlas:
30+
image: mongodb/mongodb-atlas-local
31+
hostname: mongo
32+
environment:
33+
- MONGODB_INITDB_ROOT_USERNAME=root
34+
- MONGODB_INITDB_ROOT_PASSWORD=example
3135
ports:
32-
- "27017"
36+
- 27017:27017
3337
healthcheck:
34-
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
35-
interval: 30s
36-
timeout: 10s
37-
retries: 6
38-
start_period: 240s
38+
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
39+
interval: 10s
40+
timeout: 5s
41+
retries: 5
42+
start_period: 30s
43+
44+
mongo:
45+
image: mongo:8
46+
hostname: mongo8
3947
environment:
40-
MONGO_INITDB_DATABASE: my_db
41-
MONGO_INITDB_ROOT_USERNAME: root
42-
MONGO_INITDB_ROOT_PASSWORD: example
43-
command: mongod --auth
48+
- MONGO_INITDB_ROOT_USERNAME=root
49+
- MONGO_INITDB_ROOT_PASSWORD=example
50+
ports:
51+
- 27018:27017
52+
healthcheck:
53+
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
54+
interval: 10s
55+
timeout: 5s
56+
retries: 5
57+
start_period: 30s
Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
{
2-
"variables" : [ {
3-
"name" : "MONGO_HOSTNAME",
4-
"value" : "mongo",
5-
"description" : "The MongoDB hostname"
6-
}, {
7-
"name" : "MONGO_PORT",
8-
"value" : "27017",
9-
"description" : "The data port "
10-
}, {
11-
"name" : "MONGO_USERNAME",
12-
"value" : "root",
13-
"description" : "Username: none"
14-
}, {
15-
"name" : "MONGO_PASSWORD",
16-
"value" : "Encrypted 2be98afc86aa7f2e4cb1cb671d382a3df",
17-
"description" : "Password: none"
18-
} ]
2+
"variables" : [
3+
{
4+
"name" : "MONGO_HOSTNAME",
5+
"value" : "mongo",
6+
"description" : "The MongoDB hostname"
7+
},
8+
{
9+
"name" : "MONGO_PORT",
10+
"value" : "27017",
11+
"description" : "The data port "
12+
},
13+
{
14+
"name" : "MONGO_USERNAME",
15+
"value" : "root",
16+
"description" : "Username: none"
17+
},
18+
{
19+
"name" : "MONGO_PASSWORD",
20+
"value" : "example",
21+
"description" : "Password: none"
22+
},
23+
{
24+
"name" : "MONGO_ATLAS_HOSTNAME",
25+
"value" : "mongo-atlas",
26+
"description" : "The MongoDB Atlas hostname"
27+
}
28+
]
1929
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"authenticationDatabaseName": "admin",
3+
"journaled": true,
4+
"appName": "",
5+
"dbName": "hop_test",
6+
"authenticationUser": "${MONGO_USERNAME}",
7+
"connectTimeoutMs": "",
8+
"writeConcern": "",
9+
"authenticationPassword": "${MONGO_PASSWORD}",
10+
"connectionType": "STANDARD",
11+
"usingAllReplicaSetMembers": false,
12+
"usingSslSocketFactory": false,
13+
"replicationTimeoutMs": "",
14+
"hostname": "${MONGO_ATLAS_HOSTNAME}",
15+
"port": "${MONGO_PORT}",
16+
"name": "mongo-atlas",
17+
"readPreference": "PRIMARY",
18+
"socketTimeoutMs": "",
19+
"readPrefTagSets": "",
20+
"authenticationMechanism": "SCRAM_SHA_1"
21+
}

integration-tests/mongo/metadata/mongodb-connection/mongo.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"authenticationDatabaseName": "admin",
3+
"connectionString": "mongodb+srv://hans:YA3WDb8XxYDkZ8fJHrBF@hans-test.ovlgcdt.mongodb.net/?appName\u003dhans-test",
34
"usingKerberos": false,
45
"journaled": true,
5-
"dbName": "local",
6+
"dbName": "hop_test",
67
"authenticationUser": "${MONGO_USERNAME}",
78
"connectTimeoutMs": "",
89
"writeConcern": "",
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"database_replacements": [],
3+
"autoOpening": true,
4+
"description": "",
5+
"persist_filename": "",
6+
"test_type": "UNIT_TEST",
7+
"variableValues": [],
8+
"basePath": "${HOP_UNIT_TESTS_FOLDER}",
9+
"golden_data_sets": [
10+
{
11+
"field_mappings": [
12+
{
13+
"transform_field": "birthdate",
14+
"data_set_field": "birthdate"
15+
},
16+
{
17+
"transform_field": "city",
18+
"data_set_field": "city"
19+
},
20+
{
21+
"transform_field": "firstname",
22+
"data_set_field": "firstname"
23+
},
24+
{
25+
"transform_field": "housenr",
26+
"data_set_field": "housenr"
27+
},
28+
{
29+
"transform_field": "id",
30+
"data_set_field": "id"
31+
},
32+
{
33+
"transform_field": "name",
34+
"data_set_field": "name"
35+
},
36+
{
37+
"transform_field": "state",
38+
"data_set_field": "state"
39+
},
40+
{
41+
"transform_field": "stateCode",
42+
"data_set_field": "stateCode"
43+
},
44+
{
45+
"transform_field": "street",
46+
"data_set_field": "street"
47+
},
48+
{
49+
"transform_field": "zip",
50+
"data_set_field": "zip"
51+
}
52+
],
53+
"field_order": [
54+
"id"
55+
],
56+
"data_set_name": "customers",
57+
"transform_name": "Dummy (do nothing)"
58+
}
59+
],
60+
"input_data_sets": [],
61+
"name": "mongo-input-parent UNIT",
62+
"trans_test_tweaks": [],
63+
"pipeline_filename": "./tests/mdi-tests/mongo-input-parent.hpl"
64+
}

0 commit comments

Comments
 (0)