Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
Nix
12345678910111213141516171819202122232425262728293031323334353637# This test starts mongodb and runs a query using mongo shell{ config, lib, ... }:let # required for test execution on darwin pkgs = config.node.pkgs; testQuery = pkgs.writeScript "nixtest.js" '' db.greetings.insertOne({ "greeting": "hello" }); print(db.greetings.findOne().greeting); ''; mongoshExe = lib.getExe pkgs.mongosh;in{ name = "mongodb"; meta.maintainers = with pkgs.lib.maintainers; [ offline phile314 niklaskorz ];
nodes.mongodb = { services.mongodb.enable = true; };
testScript = '' start_all()
with subtest("start mongodb"): mongodb.wait_for_unit("mongodb.service") mongodb.wait_for_open_port(27017)
with subtest("insert and find a document"): result = mongodb.succeed("${mongoshExe} ${testQuery}") print("Test output:", result) assert result.strip() == "hello" '';}