Skip to content

Commit 07b9d60

Browse files
authored
Truncate test result files (#2255)
Problem: The NFR tests need to update the edge results, but they are appending the new results to the existing ones Solution: Truncate existing results files so that the content is replaced and we see the diff in the PR
1 parent 13c0163 commit 07b9d60

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.github/workflows/nfr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ jobs:
159159
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
160160
with:
161161
path: tests/results/
162+
merge-multiple: true
162163

163164
- name: Open a PR with the results
164165
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0

tests/framework/results.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func CreateResultsDir(testName, version string) (string, error) {
2525

2626
// CreateResultsFile creates and returns the results file for a test.
2727
func CreateResultsFile(filename string) (*os.File, error) {
28-
outFile, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0o777)
28+
outFile, err := os.OpenFile(filename, os.O_TRUNC|os.O_WRONLY|os.O_CREATE, 0o644)
2929
if err != nil {
3030
return nil, err
3131
}

0 commit comments

Comments
 (0)