anchor.diff: -# This test runs gitlab and checks if it works
  +# This test runs gitlab and performs the following tests:
  +# - Creating users
  +# - Pushing commits
  +#   - over the API
  +#   - over SSH
  +# - Creating Merge Requests and merging them
  +# - Opening and closing issues.
  +# - Downloading repository archives as tar.gz and tar.bz2
  +import ./make-test-python.nix ({ pkgs, lib, ... }:
  +
  +with lib;
   
   let
  +  inherit (import ./ssh-keys.nix pkgs) snakeOilPrivateKey snakeOilPublicKey;
     initialRootPassword = "notproduction";
  -in
  -import ./make-test-python.nix ({ pkgs, lib, ...} : with lib; {
  +  rootProjectId = "2";
  +
  +  aliceUsername = "alice";
  +  aliceUserId = "2";
  +  alicePassword = "alicepassword";
  +  aliceProjectId = "2";
  +  aliceProjectName = "test-alice";
  +
  +  bobUsername = "bob";
  +  bobUserId = "3";
  +  bobPassword = "bobpassword";
  +  bobProjectId = "3";
  +in {
     name = "gitlab";
     meta = with pkgs.lib.maintainers; {
       maintainers = [ globin yayayayaka ];
  
positive.code:             "echo \"Authorization: Bearer $(curl -X POST -H 'Content-Type: application/json' -d @${auth} http://gitlab/oauth/token | ${pkgs.jq}/bin/jq -r '.access_token')\" >/tmp/headers"
          )
        '' + optionalString doSetup ''
          gitlab.succeed(
              """[ "$(curl -o /dev/null -w '%{http_code}' -X POST -H 'Content-Type: application/json' -H @/tmp/headers -d @${createProject} http://gitlab/api/v4/projects)" = "201" ]"""
          )
          gitlab.succeed(
              """[ "$(curl -o /dev/null -w '%{http_code}' -X POST -H 'Content-Type: application/json' -H @/tmp/headers -d @${putFile} http://gitlab/api/v4/projects/2/repository/files/some-file.txt)" = "201" ]"""
          )
        '' + ''
          gitlab.succeed(
              """[ "$(curl -o /dev/null -w '%{http_code}' -H @/tmp/headers http://gitlab/api/v4/projects/2/repository/archive.tar.gz)" = "200" ]"""
          )
          gitlab.succeed(
              """curl -H @/tmp/headers http://gitlab/api/v4/projects/2/repository/archive.tar.gz > /tmp/archive.tar.gz"""
          )
          gitlab.succeed(
              """[ "$(curl -o /dev/null -w '%{http_code}' -H @/tmp/headers http://gitlab/api/v4/projects/2/repository/archive.tar.bz2)" = "200" ]"""
          )
          gitlab.succeed(
              """curl -o /dev/null -w '%{http_code}' -H @/tmp/headers http://gitlab/api/v4/projects/2/repository/archive.tar.bz2 > /tmp/archive.tar.bz2"""
          )
          gitlab.succeed("test -s /tmp/archive.tar.gz")
          gitlab.succeed("test -s /tmp/archive.tar.bz2")
        '';
  
    in ''
  
negative.code:         password = initialRootPassword;
        });
  
        createUserAlice = pkgs.writeText "create-user-alice.json" (builtins.toJSON rec {
          username = aliceUsername;
          name = username;
          email = "alice@localhost";
          password = alicePassword;
          skip_confirmation = true;
        });
  
        createUserBob = pkgs.writeText "create-user-bob.json" (builtins.toJSON rec {
          username = bobUsername;
          name = username;
          email = "bob@localhost";
          password = bobPassword;
          skip_confirmation = true;
        });
  
        aliceAuth = pkgs.writeText "alice-auth.json" (builtins.toJSON {
          grant_type = "password";
          username = aliceUsername;
          password = alicePassword;
        });
  
        bobAuth = pkgs.writeText "bob-auth.json" (builtins.toJSON {
          grant_type = "password";
          username = bobUsername;
          password = bobPassword;
        });
  
        aliceAddSSHKey = pkgs.writeText "alice-add-ssh-key.json" (builtins.toJSON {
          id = aliceUserId;
          title = "snakeoil@nixos";
          key = snakeOilPublicKey;
        });
  
        createProjectAlice = pkgs.writeText "create-project-alice.json" (builtins.toJSON {
          name = aliceProjectName;
          visibility = "public";
        });
  
        putFile = pkgs.writeText "put-file.json" (builtins.toJSON {
  