git.iko.soy/typeable/nixpkgs
on master help sign in
gitlab tests: enable recommendedProxySettings, test redirection works as it should

The nixos test is a bit misleading, as the given nginx configuration would always cause gitlab to redirect to localhost, which is clearly not what you want in a production setup. Instead we now enable services.nginx.recommendedProxySettings, curl against http://gitlab, and assure we get redirected to that same hostname, too.

commit6870eafe724a4f864ae54a5ae75cb6e00a4f76ad authorFlorian Klink <flokli@flokli.de> dateFri 23 Nov 2018, 19:36 (8 years ago) parent63f2547
1 file changed+3−1
nixos/tests/gitlab.nix+3−1
nixos/tests/gitlab.nix+3−1
@@ -16,6 +16,7 @@ import ./make-test.nix ({ pkgs, lib, ...} : with lib; {
1616
1717 services.nginx = {
1818 enable = true;
19+ recommendedProxySettings = true;
1920 virtualHosts = {
2021 "localhost" = {
2122 locations."/".proxyPass = "http://unix:/run/gitlab/gitlab-workhorse.socket";
@@ -75,7 +76,8 @@ import ./make-test.nix ({ pkgs, lib, ...} : with lib; {
7576 $gitlab->waitForUnit("gitlab.service");
7677 $gitlab->waitForUnit("gitlab-sidekiq.service");
7778 $gitlab->waitForFile("/var/gitlab/state/tmp/sockets/gitlab.socket");
78− $gitlab->waitUntilSucceeds("curl -sSf http://localhost/users/sign_in");
79+ $gitlab->waitUntilSucceeds("curl -sSf http://gitlab/users/sign_in");
80+ $gitlab->succeed("curl -isSf http://gitlab | grep -i location | grep -q http://gitlab/users/sign_in");
7981 $gitlab->succeed("${pkgs.sudo}/bin/sudo -u gitlab -H gitlab-rake gitlab:check 1>&2")
8082 '';
8183})