Merge pull request #472 from gavin-ts/fix-e2ereport-with-delta-flag
fix e2ereport script with delta flag
This commit is contained in:
commit
23d253f7b6
2 changed files with 9 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ set -eu
|
||||||
|
|
||||||
export REPORT_OUTPUT="out/e2e_report.html"
|
export REPORT_OUTPUT="out/e2e_report.html"
|
||||||
rm -f $REPORT_OUTPUT
|
rm -f $REPORT_OUTPUT
|
||||||
|
export E2E_REPORT=1
|
||||||
|
|
||||||
FORCE_COLOR=1 DEBUG=1 go run ./e2etests/report/main.go "$@";
|
FORCE_COLOR=1 DEBUG=1 go run ./e2etests/report/main.go "$@";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,11 @@ func run(t *testing.T, tc testCase) {
|
||||||
assert.Success(t, err)
|
assert.Success(t, err)
|
||||||
err = ioutil.WriteFile(pathGotSVG, svgBytes, 0600)
|
err = ioutil.WriteFile(pathGotSVG, svgBytes, 0600)
|
||||||
assert.Success(t, err)
|
assert.Success(t, err)
|
||||||
defer os.Remove(pathGotSVG)
|
// if running from e2ereport.sh, we want to keep .got.svg on a failure
|
||||||
|
forReport := os.Getenv("E2E_REPORT") != ""
|
||||||
|
if !forReport {
|
||||||
|
defer os.Remove(pathGotSVG)
|
||||||
|
}
|
||||||
|
|
||||||
var xmlParsed interface{}
|
var xmlParsed interface{}
|
||||||
err = xml.Unmarshal(svgBytes, &xmlParsed)
|
err = xml.Unmarshal(svgBytes, &xmlParsed)
|
||||||
|
|
@ -143,6 +147,9 @@ func run(t *testing.T, tc testCase) {
|
||||||
err = diff.Testdata(filepath.Join(dataPath, "sketch"), ".svg", svgBytes)
|
err = diff.Testdata(filepath.Join(dataPath, "sketch"), ".svg", svgBytes)
|
||||||
assert.Success(t, err)
|
assert.Success(t, err)
|
||||||
}
|
}
|
||||||
|
if forReport {
|
||||||
|
os.Remove(pathGotSVG)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue