File tree Expand file tree Collapse file tree
pkgs/by-name/xu/xunit-viewer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 buildNpmPackage ,
44 fetchFromGitHub ,
55 nix-update-script ,
6+ callPackage ,
7+ testers , xunit-viewer ,
68} :
79let
810 version = "10.6.1" ;
@@ -22,6 +24,14 @@ buildNpmPackage {
2224
2325 passthru . updateScript = nix-update-script { } ;
2426
27+ passthru . tests = {
28+ version = testers . testVersion {
29+ package = xunit-viewer ;
30+ version = "unknown" ; # broken, but at least it runs
31+ } ;
32+ example = callPackage ./test/example.nix { } ;
33+ } ;
34+
2535 meta = {
2636 description = "View your xunit results using JavaScript" ;
2737 homepage = "https://lukejpreston.github.io/xunit-viewer" ;
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!-- taken from the nix test suite and then stripped down -->
3+ <testsuites tests =" 280" failures =" 0" disabled =" 2" errors =" 0" time =" 0.2" timestamp =" 2024-06-16T13:50:02.511" name =" AllTests" >
4+ <testsuite name =" parseShebangContent" tests =" 14" failures =" 0" disabled =" 0" skipped =" 0" errors =" 0" time =" 0.001" timestamp =" 2024-06-16T13:50:02.511" >
5+ <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" />
6+ <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" />
7+ </testsuite >
8+ </testsuites >
Original file line number Diff line number Diff line change 1+ { xunit-viewer , runCommand , ... } :
2+
3+ runCommand "test-xunit-viewer" {
4+ nativeBuildInputs = [ xunit-viewer ] ;
5+ } ''
6+ mkdir $out
7+ xunit-viewer -r ${ ./example.junit.xml } -o $out/index.html
8+ ( set -x
9+ grep '<body' $out/index.html
10+ # Can't easily grep for parts of the original data, because it ends up
11+ # embedded as base64 encoded data (and slightly modified?).
12+ # We'd have to really dissect it or render it with a browser.
13+ # Fortunately, we've already caught the most severe packaging problems
14+ # with just this.
15+ )
16+ ''
You can’t perform that action at this time.
0 commit comments