Skip to content

Commit 9b48cc1

Browse files
committed
microbench-ci: fix status reporting
Previously, in some cases we did not set `NoChange` if the benchmark was unchanged. The regression marker file should also only be written to the New revision.
1 parent 075e523 commit 9b48cc1

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

pkg/cmd/microbench-ci/run.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ func (b *Benchmark) run() error {
103103
// iterations. Retries are run once a benchmark has regressed or improved,
104104
// on the first try, to ensure that the change is not a fluke.
105105
if currentStatus == NoChange {
106+
status = currentStatus
106107
break
107108
}
108109

@@ -122,12 +123,10 @@ func (b *Benchmark) run() error {
122123

123124
// Write change marker file if the benchmark changed.
124125
if status != NoChange {
125-
for _, revision := range []Revision{New, Old} {
126-
marker := strings.ToUpper(status.String())
127-
err := os.WriteFile(path.Join(suite.artifactsDir(revision), "."+marker), nil, 0644)
128-
if err != nil {
129-
return err
130-
}
126+
marker := strings.ToUpper(status.String())
127+
err := os.WriteFile(path.Join(suite.artifactsDir(New), "."+marker), nil, 0644)
128+
if err != nil {
129+
return err
131130
}
132131
}
133132

pkg/cmd/microbench-ci/testdata/regression.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ tree
147147

148148
/abcdef123
149149
/abcdef123/artifacts
150-
/abcdef123/artifacts/.REGRESSED
151150
/abcdef123/artifacts/cleaned_Sysbench_SQL_3node_oltp_read_write.log
152151
/abcdef123/artifacts/cpu_Sysbench_SQL_3node_oltp_read_write_merged.prof
153152
/abcdef123/artifacts/memory_Sysbench_SQL_3node_oltp_read_write_merged.prof

pkg/cmd/microbench-ci/testdata/summary.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ tree
127127

128128
/abcdef123
129129
/abcdef123/artifacts
130-
/abcdef123/artifacts/.REGRESSED
131130
/abcdef123/artifacts/cleaned_Sysbench_SQL_3node_oltp_read_write.log
132131
/abcdef123/artifacts/cpu_Sysbench_SQL_3node_oltp_read_write_merged.prof
133132
/abcdef123/artifacts/memory_Sysbench_SQL_3node_oltp_read_write_merged.prof
@@ -136,7 +135,6 @@ tree
136135
/github-summary.md
137136
/qwerty456
138137
/qwerty456/artifacts
139-
/qwerty456/artifacts/.REGRESSED
140138
/qwerty456/artifacts/cleaned_Sysbench_SQL_3node_oltp_read_write.log
141139
/qwerty456/artifacts/cpu_Sysbench_SQL_3node_oltp_read_write_merged.prof
142140
/qwerty456/artifacts/memory_Sysbench_SQL_3node_oltp_read_write_merged.prof

0 commit comments

Comments
 (0)