Commit 6b38c11d authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #44979 from shyamjvs/fix-metrics-json-filename

Automatic merge from submit-queue (batch tested with PRs 41106, 44346, 44929, 44979, 45027) Make metrics filenames for e2e tests indicate the test better Currently the names of the json files with metrics for e2e tests are named by appending the `SummaryKind` with a timestamp of the test. It took me some time to figure out which file corresponds to which e2e test due to this. Changing it to have the testname instead of the timestamp. cc @wojtek-t @gmarek
parents 6251ff47 647a1563
...@@ -348,7 +348,7 @@ func (f *Framework) AfterEach() { ...@@ -348,7 +348,7 @@ func (f *Framework) AfterEach() {
Logf(summaries[i].PrintHumanReadable()) Logf(summaries[i].PrintHumanReadable())
} else { } else {
// TODO: learn to extract test name and append it to the kind instead of timestamp. // TODO: learn to extract test name and append it to the kind instead of timestamp.
filePath := path.Join(TestContext.ReportDir, summaries[i].SummaryKind()+now.Format(time.RFC3339)+".txt") filePath := path.Join(TestContext.ReportDir, summaries[i].SummaryKind()+"_"+f.BaseName+"_"+now.Format(time.RFC3339)+".txt")
if err := ioutil.WriteFile(filePath, []byte(summaries[i].PrintHumanReadable()), 0644); err != nil { if err := ioutil.WriteFile(filePath, []byte(summaries[i].PrintHumanReadable()), 0644); err != nil {
Logf("Failed to write file %v with test performance data: %v", filePath, err) Logf("Failed to write file %v with test performance data: %v", filePath, err)
} }
...@@ -361,7 +361,7 @@ func (f *Framework) AfterEach() { ...@@ -361,7 +361,7 @@ func (f *Framework) AfterEach() {
Logf("Finished") Logf("Finished")
} else { } else {
// TODO: learn to extract test name and append it to the kind instead of timestamp. // TODO: learn to extract test name and append it to the kind instead of timestamp.
filePath := path.Join(TestContext.ReportDir, summaries[i].SummaryKind()+now.Format(time.RFC3339)+".json") filePath := path.Join(TestContext.ReportDir, summaries[i].SummaryKind()+"_"+f.BaseName+"_"+now.Format(time.RFC3339)+".json")
if err := ioutil.WriteFile(filePath, []byte(summaries[i].PrintJSON()), 0644); err != nil { if err := ioutil.WriteFile(filePath, []byte(summaries[i].PrintJSON()), 0644); err != nil {
Logf("Failed to write file %v with test performance data: %v", filePath, err) Logf("Failed to write file %v with test performance data: %v", filePath, err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment