diff --git a/tests/robustness/README.md b/tests/robustness/README.md index ebea3b450..36c8415cb 100644 --- a/tests/robustness/README.md +++ b/tests/robustness/README.md @@ -31,6 +31,7 @@ Upon failure tests generate a report that can be used to attribute whether failu It is recommended to run tests multiple times with failfast enabled. this can be done by setting `GO_TEST_FLAGS='--count=100 --failfast'`. * `EXPECT_DEBUG=true` - to get logs from the cluster. * `RESULTS_DIR` - to change location where results report will be saved. + * `PERSIST_RESULTS` - to persist the results report of the test. By default this will not be persisted in the case of a successful run. ## Analysing failure diff --git a/tests/robustness/report/report.go b/tests/robustness/report/report.go index 3c41bc02d..fb376fcc7 100644 --- a/tests/robustness/report/report.go +++ b/tests/robustness/report/report.go @@ -59,7 +59,8 @@ func testResultsDirectory(t *testing.T) string { func (r *TestReport) Report(t *testing.T, force bool) { path := testResultsDirectory(t) - if t.Failed() || force { + _, ok := os.LookupEnv("PERSIST_RESULTS") + if t.Failed() || force || ok { for _, member := range r.Cluster.Procs { memberDataDir := filepath.Join(path, fmt.Sprintf("server-%s", member.Config().Name)) persistMemberDataDir(t, r.Logger, member, memberDataDir)