summary refs log tree commit diff
path: root/nixos/tests/nexus.nix
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2018-05-15 14:10:29 +0200
committerxeji <36407913+xeji@users.noreply.github.com>2018-05-15 14:10:29 +0200
commit91365cd23abc28395b78b53d67b280f5b159a906 (patch)
tree4d3b05da908e98cd4feb759ba7ba6d2892aeb5e0 /nixos/tests/nexus.nix
parent640b6359ae316750f02c36f17557e4ed9ffcdf44 (diff)
downloadnixpkgs-91365cd23abc28395b78b53d67b280f5b159a906.tar
nixpkgs-91365cd23abc28395b78b53d67b280f5b159a906.tar.gz
nixpkgs-91365cd23abc28395b78b53d67b280f5b159a906.tar.bz2
nixpkgs-91365cd23abc28395b78b53d67b280f5b159a906.tar.lz
nixpkgs-91365cd23abc28395b78b53d67b280f5b159a906.tar.xz
nixpkgs-91365cd23abc28395b78b53d67b280f5b159a906.tar.zst
nixpkgs-91365cd23abc28395b78b53d67b280f5b159a906.zip
nexus: fix setup and nixos test (#40522)
The original `nexus` derivation required `/run/sonatype-work/nexus3`
which explicitly depended on the NixOS path structure.

This would break `nexus` for everyone using `nixpkgs` on a non-NixOS
system, additionally the module never created `/run/sonatype-work`, so
the systemd unit created in `services.nexus` fails as well. The issue
wasn't actively known as the `nixos/nexus` test wasn't registered in
Hydra (see #40257).

This patch contains the following changes:

* Adds `tests.nexus` to `release.nix` to run the test on Hydra.

* Makes JVM parameters configurable: by default all JVM options were located
  in `result/bin/nexus.vmoptions` which made it quite hard to patch
  these parameters. Now it's possible to override all parameters by
  running `VM_OPTS_FILE=custom-nexus.vmoptions ./result/bin/nexus run`
  (after patching the `nexus` shell script), additionally it's possible
  to override these parameters with `services.nexus.vmoptions`.

* Bumped Nexus from 3.5.1 to 3.11.0

* Run the `nexus` test on Hydra with `callTest` in `nixos/release.nix`,
  furthermore the test checks if the UI is available on the specified
  port.

* Added myself as maintainer for the NixOS test and the package to have
  some more people in case of further breakage.

* Added sufficient disk space to the `nexus` test, otherwise the service
  fails with the following errors:

  ```
  com.orientechnologies.orient.core.exception.ODatabaseException: Cannot create database 'accesslog'
  com.orientechnologies.orient.core.exception.OLowDiskSpaceException: Error occurred while executing
    a write operation to database 'accesslog' due to limited free space on the disk (242 MB). The database
    is now working in read-only mode. Please close the database (or stop OrientDB), make room on your hard
    drive and then reopen the database. The minimal required space is 256 MB. Required space is now set to
    256MB (you can change it by setting parameter storage.diskCache.diskFreeSpaceLimit) .
  ```

/cc @ironpinguin @xeji
Diffstat (limited to 'nixos/tests/nexus.nix')
-rw-r--r--nixos/tests/nexus.nix16
1 files changed, 7 insertions, 9 deletions
diff --git a/nixos/tests/nexus.nix b/nixos/tests/nexus.nix
index 1f19fc0867a..d12d06c2c00 100644
--- a/nixos/tests/nexus.nix
+++ b/nixos/tests/nexus.nix
@@ -1,12 +1,12 @@
 # verifies:
 #   1. nexus service starts on server
-#   2. nexus user can be extended on server
-#   3. nexus service not can startup on server (creating database and all other initial stuff)
+#   2. nexus service can startup on server (creating database and all other initial stuff)
+#   3. the web application is reachable via HTTP
 
 import ./make-test.nix ({ pkgs, ...} : {
   name = "nexus";
   meta = with pkgs.stdenv.lib.maintainers; {
-    maintainers = [ ironpinguin ];
+    maintainers = [ ironpinguin ma27 ];
   };
 
   nodes = {
@@ -14,21 +14,19 @@ import ./make-test.nix ({ pkgs, ...} : {
     server =
       { config, pkgs, ... }:
       { virtualisation.memorySize = 2048;
+        virtualisation.diskSize = 2048;
 
         services.nexus.enable = true;
-
-        users.extraUsers.nexus.extraGroups = [ "users" ];
       };
+
   };
 
   testScript = ''
     startAll;
 
     $server->waitForUnit("nexus");
-
-    print $server->execute("sudo -u nexus groups");
-    $server->mustSucceed("sudo -u nexus groups | grep nexus | grep users");
-
     $server->waitForOpenPort(8081);
+
+    $server->succeed("curl -f 127.0.0.1:8081");
   '';
 })