Skip to content

Commit dcf15e8

Browse files
committed
fix: redact the dir paths
1 parent cf2c872 commit dcf15e8

File tree

4 files changed

+53
-47
lines changed

4 files changed

+53
-47
lines changed

go-runner/Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go-runner/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ statrs = { version = "0.18.0", default-features = false }
2020
thiserror = "2.0.12"
2121

2222
[dev-dependencies]
23-
insta = { version = "1.43.1", features = ["json"] }
23+
insta = { version = "1.43.1", features = ["json", "redactions"] }
2424
rstest = "0.25.0"
2525
tempfile = "3.14.0"

go-runner/src/builder/discovery.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,11 @@ mod tests {
295295
let benchmark_packages = discover_benchmarks(packages).unwrap();
296296

297297
insta::with_settings!({sort_maps => true}, {
298-
insta::assert_json_snapshot!(benchmark_packages,);
298+
insta::assert_json_snapshot!(benchmark_packages, {
299+
".**[\"Dir\"]" => "[package_dir]",
300+
".**[\"Module\"][\"Dir\"]" => "[module_dir]",
301+
".**[\"Module\"][\"GoMod\"]" => "[go_mod_path]"
302+
});
299303
});
300304
}
301305

go-runner/src/builder/snapshots/go_runner__builder__discovery__tests__discover_benchmarks.snap

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ expression: benchmark_packages
44
---
55
{
66
"github.com/SimonWaldherr/golang-benchmarks/base64 [github.com/SimonWaldherr/golang-benchmarks/base64.test]": {
7-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/base64",
7+
"Dir": "[package_dir]",
88
"Name": "base64",
99
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/base64 [github.com/SimonWaldherr/golang-benchmarks/base64.test]",
1010
"TestGoFiles": [
@@ -20,14 +20,14 @@ expression: benchmark_packages
2020
],
2121
"Module": {
2222
"Path": "github.com/SimonWaldherr/golang-benchmarks",
23-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
24-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
23+
"Dir": "[module_dir]",
24+
"GoMod": "[go_mod_path]",
2525
"GoVersion": "1.18",
2626
"Main": true
2727
}
2828
},
2929
"github.com/SimonWaldherr/golang-benchmarks/between [github.com/SimonWaldherr/golang-benchmarks/between.test]": {
30-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/between",
30+
"Dir": "[package_dir]",
3131
"Name": "between",
3232
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/between [github.com/SimonWaldherr/golang-benchmarks/between.test]",
3333
"TestGoFiles": [
@@ -44,14 +44,14 @@ expression: benchmark_packages
4444
],
4545
"Module": {
4646
"Path": "github.com/SimonWaldherr/golang-benchmarks",
47-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
48-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
47+
"Dir": "[module_dir]",
48+
"GoMod": "[go_mod_path]",
4949
"GoVersion": "1.18",
5050
"Main": true
5151
}
5252
},
5353
"github.com/SimonWaldherr/golang-benchmarks/caseinsensitivecompare [github.com/SimonWaldherr/golang-benchmarks/caseinsensitivecompare.test]": {
54-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/caseinsensitivecompare",
54+
"Dir": "[package_dir]",
5555
"Name": "trim",
5656
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/caseinsensitivecompare [github.com/SimonWaldherr/golang-benchmarks/caseinsensitivecompare.test]",
5757
"TestGoFiles": [
@@ -66,14 +66,14 @@ expression: benchmark_packages
6666
],
6767
"Module": {
6868
"Path": "github.com/SimonWaldherr/golang-benchmarks",
69-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
70-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
69+
"Dir": "[module_dir]",
70+
"GoMod": "[go_mod_path]",
7171
"GoVersion": "1.18",
7272
"Main": true
7373
}
7474
},
7575
"github.com/SimonWaldherr/golang-benchmarks/concat [github.com/SimonWaldherr/golang-benchmarks/concat.test]": {
76-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/concat",
76+
"Dir": "[package_dir]",
7777
"Name": "concat",
7878
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/concat [github.com/SimonWaldherr/golang-benchmarks/concat.test]",
7979
"TestGoFiles": [
@@ -89,14 +89,14 @@ expression: benchmark_packages
8989
],
9090
"Module": {
9191
"Path": "github.com/SimonWaldherr/golang-benchmarks",
92-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
93-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
92+
"Dir": "[module_dir]",
93+
"GoMod": "[go_mod_path]",
9494
"GoVersion": "1.18",
9595
"Main": true
9696
}
9797
},
9898
"github.com/SimonWaldherr/golang-benchmarks/contains [github.com/SimonWaldherr/golang-benchmarks/contains.test]": {
99-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/contains",
99+
"Dir": "[package_dir]",
100100
"Name": "contains",
101101
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/contains [github.com/SimonWaldherr/golang-benchmarks/contains.test]",
102102
"TestGoFiles": [
@@ -113,14 +113,14 @@ expression: benchmark_packages
113113
],
114114
"Module": {
115115
"Path": "github.com/SimonWaldherr/golang-benchmarks",
116-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
117-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
116+
"Dir": "[module_dir]",
117+
"GoMod": "[go_mod_path]",
118118
"GoVersion": "1.18",
119119
"Main": true
120120
}
121121
},
122122
"github.com/SimonWaldherr/golang-benchmarks/embed [github.com/SimonWaldherr/golang-benchmarks/embed.test]": {
123-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/embed",
123+
"Dir": "[package_dir]",
124124
"Name": "embed",
125125
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/embed [github.com/SimonWaldherr/golang-benchmarks/embed.test]",
126126
"TestGoFiles": [
@@ -137,14 +137,14 @@ expression: benchmark_packages
137137
],
138138
"Module": {
139139
"Path": "github.com/SimonWaldherr/golang-benchmarks",
140-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
141-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
140+
"Dir": "[module_dir]",
141+
"GoMod": "[go_mod_path]",
142142
"GoVersion": "1.18",
143143
"Main": true
144144
}
145145
},
146146
"github.com/SimonWaldherr/golang-benchmarks/foreach [github.com/SimonWaldherr/golang-benchmarks/foreach.test]": {
147-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/foreach",
147+
"Dir": "[package_dir]",
148148
"Name": "foreach",
149149
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/foreach [github.com/SimonWaldherr/golang-benchmarks/foreach.test]",
150150
"TestGoFiles": [
@@ -158,14 +158,14 @@ expression: benchmark_packages
158158
],
159159
"Module": {
160160
"Path": "github.com/SimonWaldherr/golang-benchmarks",
161-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
162-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
161+
"Dir": "[module_dir]",
162+
"GoMod": "[go_mod_path]",
163163
"GoVersion": "1.18",
164164
"Main": true
165165
}
166166
},
167167
"github.com/SimonWaldherr/golang-benchmarks/hash [github.com/SimonWaldherr/golang-benchmarks/hash.test]": {
168-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/hash",
168+
"Dir": "[package_dir]",
169169
"Name": "hash",
170170
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/hash [github.com/SimonWaldherr/golang-benchmarks/hash.test]",
171171
"TestGoFiles": [
@@ -197,14 +197,14 @@ expression: benchmark_packages
197197
],
198198
"Module": {
199199
"Path": "github.com/SimonWaldherr/golang-benchmarks",
200-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
201-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
200+
"Dir": "[module_dir]",
201+
"GoMod": "[go_mod_path]",
202202
"GoVersion": "1.18",
203203
"Main": true
204204
}
205205
},
206206
"github.com/SimonWaldherr/golang-benchmarks/index [github.com/SimonWaldherr/golang-benchmarks/index.test]": {
207-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/index",
207+
"Dir": "[package_dir]",
208208
"Name": "index",
209209
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/index [github.com/SimonWaldherr/golang-benchmarks/index.test]",
210210
"TestGoFiles": [
@@ -220,14 +220,14 @@ expression: benchmark_packages
220220
],
221221
"Module": {
222222
"Path": "github.com/SimonWaldherr/golang-benchmarks",
223-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
224-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
223+
"Dir": "[module_dir]",
224+
"GoMod": "[go_mod_path]",
225225
"GoVersion": "1.18",
226226
"Main": true
227227
}
228228
},
229229
"github.com/SimonWaldherr/golang-benchmarks/json [github.com/SimonWaldherr/golang-benchmarks/json.test]": {
230-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/json",
230+
"Dir": "[package_dir]",
231231
"Name": "json",
232232
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/json [github.com/SimonWaldherr/golang-benchmarks/json.test]",
233233
"TestGoFiles": [
@@ -245,14 +245,14 @@ expression: benchmark_packages
245245
],
246246
"Module": {
247247
"Path": "github.com/SimonWaldherr/golang-benchmarks",
248-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
249-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
248+
"Dir": "[module_dir]",
249+
"GoMod": "[go_mod_path]",
250250
"GoVersion": "1.18",
251251
"Main": true
252252
}
253253
},
254254
"github.com/SimonWaldherr/golang-benchmarks/math [github.com/SimonWaldherr/golang-benchmarks/math.test]": {
255-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/math",
255+
"Dir": "[package_dir]",
256256
"Name": "math",
257257
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/math [github.com/SimonWaldherr/golang-benchmarks/math.test]",
258258
"TestGoFiles": [
@@ -268,14 +268,14 @@ expression: benchmark_packages
268268
],
269269
"Module": {
270270
"Path": "github.com/SimonWaldherr/golang-benchmarks",
271-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
272-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
271+
"Dir": "[module_dir]",
272+
"GoMod": "[go_mod_path]",
273273
"GoVersion": "1.18",
274274
"Main": true
275275
}
276276
},
277277
"github.com/SimonWaldherr/golang-benchmarks/parse [github.com/SimonWaldherr/golang-benchmarks/parse.test]": {
278-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/parse",
278+
"Dir": "[package_dir]",
279279
"Name": "parse",
280280
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/parse [github.com/SimonWaldherr/golang-benchmarks/parse.test]",
281281
"TestGoFiles": [
@@ -290,14 +290,14 @@ expression: benchmark_packages
290290
],
291291
"Module": {
292292
"Path": "github.com/SimonWaldherr/golang-benchmarks",
293-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
294-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
293+
"Dir": "[module_dir]",
294+
"GoMod": "[go_mod_path]",
295295
"GoVersion": "1.18",
296296
"Main": true
297297
}
298298
},
299299
"github.com/SimonWaldherr/golang-benchmarks/random [github.com/SimonWaldherr/golang-benchmarks/random.test]": {
300-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/random",
300+
"Dir": "[package_dir]",
301301
"Name": "random",
302302
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/random [github.com/SimonWaldherr/golang-benchmarks/random.test]",
303303
"TestGoFiles": [
@@ -315,14 +315,14 @@ expression: benchmark_packages
315315
],
316316
"Module": {
317317
"Path": "github.com/SimonWaldherr/golang-benchmarks",
318-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
319-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
318+
"Dir": "[module_dir]",
319+
"GoMod": "[go_mod_path]",
320320
"GoVersion": "1.18",
321321
"Main": true
322322
}
323323
},
324324
"github.com/SimonWaldherr/golang-benchmarks/regexp [github.com/SimonWaldherr/golang-benchmarks/regexp.test]": {
325-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/regexp",
325+
"Dir": "[package_dir]",
326326
"Name": "regexp",
327327
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/regexp [github.com/SimonWaldherr/golang-benchmarks/regexp.test]",
328328
"TestGoFiles": [
@@ -338,14 +338,14 @@ expression: benchmark_packages
338338
],
339339
"Module": {
340340
"Path": "github.com/SimonWaldherr/golang-benchmarks",
341-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
342-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
341+
"Dir": "[module_dir]",
342+
"GoMod": "[go_mod_path]",
343343
"GoVersion": "1.18",
344344
"Main": true
345345
}
346346
},
347347
"github.com/SimonWaldherr/golang-benchmarks/template [github.com/SimonWaldherr/golang-benchmarks/template.test]": {
348-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/template",
348+
"Dir": "[package_dir]",
349349
"Name": "template",
350350
"ImportPath": "github.com/SimonWaldherr/golang-benchmarks/template [github.com/SimonWaldherr/golang-benchmarks/template.test]",
351351
"TestGoFiles": [
@@ -363,8 +363,8 @@ expression: benchmark_packages
363363
],
364364
"Module": {
365365
"Path": "github.com/SimonWaldherr/golang-benchmarks",
366-
"Dir": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks",
367-
"GoMod": "/home/not-matthias/Documents/work/wgit/codspeed-go/go-runner/testdata/projects/golang-benchmarks/go.mod",
366+
"Dir": "[module_dir]",
367+
"GoMod": "[go_mod_path]",
368368
"GoVersion": "1.18",
369369
"Main": true
370370
}

0 commit comments

Comments
 (0)