diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2018-12-20 18:48:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-20 18:48:37 +0100 |
commit | 87ebc2ad0b243268b9e99a37e16460739e8512eb (patch) | |
tree | 4be82cc4d15861e6a93a75a527dc07b1f45e99e6 /nixos | |
parent | e166aca69442847c71589645c0d477e7fecbc902 (diff) | |
parent | 64d05bbdd2a745885f195b4f54fc518b07b9db7c (diff) |
Merge pull request #52345 from r-ryantm/auto-update/clickhouse
clickhouse: 18.14.9 -> 18.14.18
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/databases/clickhouse.nix | 5 | ||||
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/clickhouse.nix | 25 |
3 files changed, 31 insertions, 0 deletions
diff --git a/nixos/modules/services/databases/clickhouse.nix b/nixos/modules/services/databases/clickhouse.nix index 1b8771cec3915..21e0cee341515 100644 --- a/nixos/modules/services/databases/clickhouse.nix +++ b/nixos/modules/services/databases/clickhouse.nix @@ -70,6 +70,11 @@ with lib; }; }; + environment.systemPackages = [ pkgs.clickhouse ]; + + # startup requires a `/etc/localtime` which only if exists if `time.timeZone != null` + time.timeZone = mkDefault "UTC"; + }; } diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index ca5015ded3e89..1e8e2213fac02 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -39,6 +39,7 @@ in cfssl = handleTestOn ["x86_64-linux"] ./cfssl.nix {}; chromium = (handleTestOn ["x86_64-linux"] ./chromium.nix {}).stable or {}; cjdns = handleTest ./cjdns.nix {}; + clickhouse = handleTest ./clickhouse.nix {}; cloud-init = handleTest ./cloud-init.nix {}; codimd = handleTest ./codimd.nix {}; containers-bridge = handleTest ./containers-bridge.nix {}; diff --git a/nixos/tests/clickhouse.nix b/nixos/tests/clickhouse.nix new file mode 100644 index 0000000000000..7d835069ec4d8 --- /dev/null +++ b/nixos/tests/clickhouse.nix @@ -0,0 +1,25 @@ +import ./make-test.nix ({ pkgs, ... }: { + name = "clickhouse"; + meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ma27 ]; + + machine = { + services.clickhouse.enable = true; + }; + + testScript = + let + # work around quote/substitution complexity by Nix, Perl, bash and SQL. + tableDDL = pkgs.writeText "ddl.sql" "CREATE TABLE `demo` (`value` FixedString(10)) engine = MergeTree PARTITION BY value ORDER BY tuple();"; + insertQuery = pkgs.writeText "insert.sql" "INSERT INTO `demo` (`value`) VALUES ('foo');"; + selectQuery = pkgs.writeText "select.sql" "SELECT * from `demo`"; + in + '' + $machine->start(); + $machine->waitForUnit("clickhouse.service"); + $machine->waitForOpenPort(9000); + + $machine->succeed("cat ${tableDDL} | clickhouse-client"); + $machine->succeed("cat ${insertQuery} | clickhouse-client"); + $machine->succeed("cat ${selectQuery} | clickhouse-client | grep foo"); + ''; +}) |