mirror of
https://github.com/MAGICGrants/truenas-apps.git
synced 2026-01-09 20:47:58 -05:00
Add mongodb (#2238)
* initial mongodb * add lib * update meta * update hashes * fix * logo * quiet
This commit is contained in:
@@ -95,6 +95,7 @@ def test_mapping(variant: str, config: dict | None = None) -> str:
|
||||
"redis": redis_test,
|
||||
"postgres": postgres_test,
|
||||
"mariadb": mariadb_test,
|
||||
"mongodb": mongodb_test,
|
||||
}
|
||||
|
||||
if variant not in tests:
|
||||
@@ -208,3 +209,11 @@ def mariadb_test(config: dict) -> str:
|
||||
host = get_key(config, "host", "127.0.0.1", False)
|
||||
|
||||
return f"mariadb-admin --user=root --host={host} --port={port} --password=$MARIADB_ROOT_PASSWORD ping"
|
||||
|
||||
|
||||
def mongodb_test(config: dict) -> str:
|
||||
config = config or {}
|
||||
port = get_key(config, "port", 27017, False)
|
||||
host = get_key(config, "host", "127.0.0.1", False)
|
||||
|
||||
return f"mongosh --host {host} --port {port} $MONGO_INITDB_DATABASE --eval 'db.adminCommand(\"ping\")' --quiet"
|
||||
@@ -208,3 +208,14 @@ def test_mariadb_healthcheck(mock_values):
|
||||
output["services"]["test_container"]["healthcheck"]["test"]
|
||||
== "mariadb-admin --user=root --host=127.0.0.1 --port=3306 --password=$$MARIADB_ROOT_PASSWORD ping"
|
||||
)
|
||||
|
||||
|
||||
def test_mongodb_healthcheck(mock_values):
|
||||
render = Render(mock_values)
|
||||
c1 = render.add_container("test_container", "test_image")
|
||||
c1.healthcheck.set_test("mongodb")
|
||||
output = render.render()
|
||||
assert (
|
||||
output["services"]["test_container"]["healthcheck"]["test"]
|
||||
== "mongosh --host 127.0.0.1 --port 27017 $$MONGO_INITDB_DATABASE --eval 'db.adminCommand(\"ping\")' --quiet"
|
||||
)
|
||||
@@ -1,2 +1,2 @@
|
||||
0.0.1: f074617a82a86d2a6cc78a4c8a4296fc9d168e456f12713e50c696557b302133
|
||||
2.1.23: 59e54688cf43e573fe96d939c5a9e9a7ae74d5441ff00daa81fe9aa8d52249b9
|
||||
2.1.24: 86fdabbf2e49acd315eca1b3731bf9aadbb48ad77f54697ad7b772543a0211ad
|
||||
|
||||
Reference in New Issue
Block a user