mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
tests/robustness: allow persisting result reports for successful runs
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
This commit is contained in:
parent
cdd018ad2a
commit
b51a834645
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user