diff --git a/ci/e2ereport.sh b/ci/e2ereport.sh new file mode 100755 index 000000000..691ad8e46 --- /dev/null +++ b/ci/e2ereport.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -eu + +export REPORT_OUTPUT="out/e2e_report.html" +rm -f $REPORT_OUTPUT + +FORCE_COLOR=1 DEBUG=1 go run ./e2etests/report/main.go "$@"; + +if [ -z "${NO_OPEN:-}" ]; then + if [ -s "$REPORT_OUTPUT" ]; then + open "$REPORT_OUTPUT" + else + echo "The report is empty" + fi +fi diff --git a/e2etests/report/main.go b/e2etests/report/main.go index ee703125d..81ae168d3 100644 --- a/e2etests/report/main.go +++ b/e2etests/report/main.go @@ -140,10 +140,10 @@ func main() { Tests: tests, } - path := "e2e_report.html" + path := os.Getenv("REPORT_OUTPUT") f, err := os.Create(path) if err != nil { - panic(err) + panic(fmt.Errorf("error creating file `%s`. %v", path, err)) } if err := tmpl.Execute(f, tmplData); err != nil { panic(err)