mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 11:53:27 +00:00
Merge pull request #319020 from pluiedev/init/xunit-viewer
xunit-viewer: init at 10.6.1
This commit is contained in:
commit
a94dfb6e0a
42
pkgs/by-name/xu/xunit-viewer/package.nix
Normal file
42
pkgs/by-name/xu/xunit-viewer/package.nix
Normal file
@ -0,0 +1,42 @@
|
||||
{
|
||||
lib,
|
||||
buildNpmPackage,
|
||||
fetchFromGitHub,
|
||||
nix-update-script,
|
||||
callPackage,
|
||||
testers, xunit-viewer,
|
||||
}:
|
||||
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 { };
|
||||
|
||||
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";
|
||||
license = with lib.licenses; [ mit ];
|
||||
maintainers = with lib.maintainers; [ pluiedev ];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
8
pkgs/by-name/xu/xunit-viewer/test/example.junit.xml
Normal file
8
pkgs/by-name/xu/xunit-viewer/test/example.junit.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- taken from the nix test suite and then stripped down -->
|
||||
<testsuites tests="280" failures="0" disabled="2" errors="0" time="0.2" timestamp="2024-06-16T13:50:02.511" name="AllTests">
|
||||
<testsuite name="parseShebangContent" tests="14" failures="0" disabled="0" skipped="0" errors="0" time="0.001" timestamp="2024-06-16T13:50:02.511">
|
||||
<testcase name="basic" file="tests/unit/libutil/args.cc" line="10" status="run" result="completed" time="0." timestamp="2024-06-16T13:50:02.511" classname="parseShebangContent" />
|
||||
<testcase name="empty" file="tests/unit/libutil/args.cc" line="18" status="run" result="completed" time="0." timestamp="2024-06-16T13:50:02.511" classname="parseShebangContent" />
|
||||
</testsuite>
|
||||
</testsuites>
|
16
pkgs/by-name/xu/xunit-viewer/test/example.nix
Normal file
16
pkgs/by-name/xu/xunit-viewer/test/example.nix
Normal file
@ -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 '<body' $out/index.html
|
||||
# Can't easily grep for parts of the original data, because it ends up
|
||||
# embedded as base64 encoded data (and slightly modified?).
|
||||
# We'd have to really dissect it or render it with a browser.
|
||||
# Fortunately, we've already caught the most severe packaging problems
|
||||
# with just this.
|
||||
)
|
||||
''
|
Loading…
Reference in New Issue
Block a user