sbt: Add test

This commit is contained in:
Tim Steinbach 2020-11-03 11:51:36 -05:00
parent 8d279bbf67
commit 23be792bad
No known key found for this signature in database
GPG Key ID: FD36A5EAAC49035A
3 changed files with 48 additions and 25 deletions

View File

@ -310,6 +310,7 @@ in
rxe = handleTest ./rxe.nix {}; rxe = handleTest ./rxe.nix {};
samba = handleTest ./samba.nix {}; samba = handleTest ./samba.nix {};
sanoid = handleTest ./sanoid.nix {}; sanoid = handleTest ./sanoid.nix {};
sbt = handleTest ./sbt.nix {};
sddm = handleTest ./sddm.nix {}; sddm = handleTest ./sddm.nix {};
service-runner = handleTest ./service-runner.nix {}; service-runner = handleTest ./service-runner.nix {};
shadowsocks = handleTest ./shadowsocks {}; shadowsocks = handleTest ./shadowsocks {};

18
nixos/tests/sbt.nix Normal file
View File

@ -0,0 +1,18 @@
import ./make-test-python.nix ({ pkgs, ...} : {
name = "sbt";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ nequissimus ];
};
machine = { pkgs, ... }:
{
environment.systemPackages = [ pkgs.sbt ];
};
testScript =
''
machine.succeed(
"(sbt --offline --version 2>&1 || true) | grep 'getting org.scala-sbt sbt ${pkgs.sbt.version} (this may take some time)'"
)
'';
})

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, jre, autoPatchelfHook, zlib, writeScript { stdenv, fetchurl, jre, autoPatchelfHook, zlib, writeScript
, common-updater-scripts, git, nixfmt, nix, coreutils, gnused }: , common-updater-scripts, git, nixfmt, nix, coreutils, gnused, nixosTests }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "sbt"; pname = "sbt";
@ -36,7 +36,10 @@ stdenv.mkDerivation rec {
platforms = platforms.unix; platforms = platforms.unix;
}; };
passthru.updateScript = writeScript "update.sh" '' passthru = {
tests = { inherit (nixosTests) sbt; };
updateScript = writeScript "update.sh" ''
#!${stdenv.shell} #!${stdenv.shell}
set -o errexit set -o errexit
PATH=${ PATH=${
@ -62,4 +65,5 @@ stdenv.mkDerivation rec {
echo "sbt is already up-to-date" echo "sbt is already up-to-date"
fi fi
''; '';
};
} }