kitproj / junit2html

Convert junit.xml into gorgeous HTML reports
MIT License
11 stars 10 forks source link

[feature-request] Add support for creating single html report for multiple xml reports #3

Open or-shachar opened 1 year ago

or-shachar commented 1 year ago

I can probably work on that on a fork and if you agree you can adopt it 🙏

alexec commented 1 year ago

Yes. Would it be something like?

junit2html < *.xml > test-report.html
or-shachar commented 1 year ago

Not sure how this can be read through STD.in It might require to switch to flag with comma delimited. But I'll check if your way is feasible as it's more elegant.

or-shachar commented 1 year ago

Unfortunately writing the following project reveals that this usage will not work:

package main

import (
    "bufio"
    "fmt"
    "os"
)

func main() {
    scanner := bufio.NewScanner(os.Stdin)
    for scanner.Scan() {
        fmt.Println(scanner.Text())
    }
}

Test file:


echo "aaaaa
aaaaa
aaaaa
aaaaa" > a.temp
echo "bbbb
bbbb
bbbb
bbbb" > b.temp

go run . < *.temp

bash just doesn't like the expression it will return:

$ bash test.sh 
test.sh: line 12: *.temp: ambiguous redirect

zsh will work with the exression but there isn't any way to diffrentiate between the files:

$ zsh test.sh 
aaaaa
aaaaa
aaaaa
aaaaa
bbbb
bbbb
bbbb
bbbb
or-shachar commented 1 year ago

I've prepared something that works with glob patterns...

I still want to clean it up so it won't have multiple for lines but would love to know what you think...