From 23ab0c4be36143056181b791519eb7b94ff569c5 Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Tue, 11 Jun 2024 10:43:48 +0200 Subject: [PATCH 1/2] xunit-viewer: init at 10.6.1 --- pkgs/by-name/xu/xunit-viewer/package.nix | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pkgs/by-name/xu/xunit-viewer/package.nix diff --git a/pkgs/by-name/xu/xunit-viewer/package.nix b/pkgs/by-name/xu/xunit-viewer/package.nix new file mode 100644 index 000000000000..4978ababd1b5 --- /dev/null +++ b/pkgs/by-name/xu/xunit-viewer/package.nix @@ -0,0 +1,32 @@ +{ + lib, + buildNpmPackage, + fetchFromGitHub, + nix-update-script, +}: +let + version = "10.6.1"; +in +buildNpmPackage { + pname = "xunit-viewer"; + inherit version; + + src = fetchFromGitHub { + owner = "lukejpreston"; + repo = "xunit-viewer"; + rev = "v${version}"; + hash = "sha256-n9k1Z/wofExG6k/BxtkU8M+Lo3XdCgCh8VFj9jcwL1Q="; + }; + + npmDepsHash = "sha256-6PV0+G1gzUWUjOfwRtVeALVFFiwkCAB33yB9W0PCGfc="; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "View your xunit results using JavaScript"; + homepage = "https://lukejpreston.github.io/xunit-viewer"; + license = with lib.licenses; [ mit ]; + maintainers = with lib.maintainers; [ pluiedev ]; + platforms = lib.platforms.all; + }; +} From 5b8c64f198ff59b13c651ac80967f6052f6f987b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 16 Jun 2024 14:30:24 +0200 Subject: [PATCH 2/2] xunit-viewer: Add basic tests --- pkgs/by-name/xu/xunit-viewer/package.nix | 10 ++++++++++ .../xu/xunit-viewer/test/example.junit.xml | 8 ++++++++ pkgs/by-name/xu/xunit-viewer/test/example.nix | 16 ++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 pkgs/by-name/xu/xunit-viewer/test/example.junit.xml create mode 100644 pkgs/by-name/xu/xunit-viewer/test/example.nix diff --git a/pkgs/by-name/xu/xunit-viewer/package.nix b/pkgs/by-name/xu/xunit-viewer/package.nix index 4978ababd1b5..7c31b82aac7b 100644 --- a/pkgs/by-name/xu/xunit-viewer/package.nix +++ b/pkgs/by-name/xu/xunit-viewer/package.nix @@ -3,6 +3,8 @@ buildNpmPackage, fetchFromGitHub, nix-update-script, + callPackage, + testers, xunit-viewer, }: let version = "10.6.1"; @@ -22,6 +24,14 @@ buildNpmPackage { passthru.updateScript = nix-update-script { }; + passthru.tests = { + version = testers.testVersion { + package = xunit-viewer; + version = "unknown"; # broken, but at least it runs + }; + example = callPackage ./test/example.nix { }; + }; + meta = { description = "View your xunit results using JavaScript"; homepage = "https://lukejpreston.github.io/xunit-viewer"; diff --git a/pkgs/by-name/xu/xunit-viewer/test/example.junit.xml b/pkgs/by-name/xu/xunit-viewer/test/example.junit.xml new file mode 100644 index 000000000000..a87b270fe2f3 --- /dev/null +++ b/pkgs/by-name/xu/xunit-viewer/test/example.junit.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/pkgs/by-name/xu/xunit-viewer/test/example.nix b/pkgs/by-name/xu/xunit-viewer/test/example.nix new file mode 100644 index 000000000000..574b9d784951 --- /dev/null +++ b/pkgs/by-name/xu/xunit-viewer/test/example.nix @@ -0,0 +1,16 @@ +{ xunit-viewer, runCommand, ... }: + +runCommand "test-xunit-viewer" { + nativeBuildInputs = [ xunit-viewer ]; +} '' + mkdir $out + xunit-viewer -r ${./example.junit.xml} -o $out/index.html + ( set -x + grep '