Merge pull request #217890 from IndeedNotJames/nixos-tests-gitea

nixos/tests/gitea: open up test for forgejo
This commit is contained in:
Nick Cao 2023-02-25 09:55:43 +08:00 committed by GitHub
commit eb03dde70d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -228,6 +228,7 @@ in {
fluentd = handleTest ./fluentd.nix {}; fluentd = handleTest ./fluentd.nix {};
fluidd = handleTest ./fluidd.nix {}; fluidd = handleTest ./fluidd.nix {};
fontconfig-default-fonts = handleTest ./fontconfig-default-fonts.nix {}; fontconfig-default-fonts = handleTest ./fontconfig-default-fonts.nix {};
forgejo = handleTest ./gitea.nix { giteaPackage = pkgs.forgejo; };
freenet = handleTest ./freenet.nix {}; freenet = handleTest ./freenet.nix {};
freeswitch = handleTest ./freeswitch.nix {}; freeswitch = handleTest ./freeswitch.nix {};
freshrss-sqlite = handleTest ./freshrss-sqlite.nix {}; freshrss-sqlite = handleTest ./freshrss-sqlite.nix {};
@ -241,7 +242,7 @@ in {
geth = handleTest ./geth.nix {}; geth = handleTest ./geth.nix {};
ghostunnel = handleTest ./ghostunnel.nix {}; ghostunnel = handleTest ./ghostunnel.nix {};
gitdaemon = handleTest ./gitdaemon.nix {}; gitdaemon = handleTest ./gitdaemon.nix {};
gitea = handleTest ./gitea.nix {}; gitea = handleTest ./gitea.nix { giteaPackage = pkgs.gitea; };
gitlab = handleTest ./gitlab.nix {}; gitlab = handleTest ./gitlab.nix {};
gitolite = handleTest ./gitolite.nix {}; gitolite = handleTest ./gitolite.nix {};
gitolite-fcgiwrap = handleTest ./gitolite-fcgiwrap.nix {}; gitolite-fcgiwrap = handleTest ./gitolite-fcgiwrap.nix {};

View file

@ -1,5 +1,6 @@
{ system ? builtins.currentSystem, { system ? builtins.currentSystem,
config ? {}, config ? {},
giteaPackage,
pkgs ? import ../.. { inherit system config; } pkgs ? import ../.. { inherit system config; }
}: }:
@ -9,8 +10,8 @@ with pkgs.lib;
let let
supportedDbTypes = [ "mysql" "postgres" "sqlite3" ]; supportedDbTypes = [ "mysql" "postgres" "sqlite3" ];
makeGiteaTest = type: nameValuePair type (makeTest { makeGiteaTest = type: nameValuePair type (makeTest {
name = "gitea-${type}"; name = "${giteaPackage.pname}-${type}";
meta.maintainers = with maintainers; [ aanderse kolaente ma27 ]; meta.maintainers = with maintainers; [ aanderse indeednotjames kolaente ma27 ];
nodes = { nodes = {
server = { config, pkgs, ... }: { server = { config, pkgs, ... }: {
@ -18,9 +19,10 @@ let
services.gitea = { services.gitea = {
enable = true; enable = true;
database = { inherit type; }; database = { inherit type; };
package = giteaPackage;
settings.service.DISABLE_REGISTRATION = true; settings.service.DISABLE_REGISTRATION = true;
}; };
environment.systemPackages = [ pkgs.gitea pkgs.jq ]; environment.systemPackages = [ giteaPackage pkgs.jq ];
services.openssh.enable = true; services.openssh.enable = true;
}; };
client1 = { config, pkgs, ... }: { client1 = { config, pkgs, ... }: {

View file

@ -10,6 +10,7 @@
, lib , lib
, makeWrapper , makeWrapper
, nix , nix
, nixosTests
, openssh , openssh
, pam , pam
, pamSupport ? true , pamSupport ? true
@ -65,6 +66,8 @@ buildGoModule rec {
--prefix PATH : ${lib.makeBinPath [ bash git gzip openssh ]} --prefix PATH : ${lib.makeBinPath [ bash git gzip openssh ]}
''; '';
passthru.tests = nixosTests.forgejo;
passthru.updateScript = lib.getExe (writeShellApplication { passthru.updateScript = lib.getExe (writeShellApplication {
name = "update-forgejo"; name = "update-forgejo";
runtimeInputs = [ runtimeInputs = [