Skip to content

Commit aa2c031

Browse files
committed
feat: add caddy submodule and test
1 parent 4058b96 commit aa2c031

File tree

5 files changed

+119
-3
lines changed

5 files changed

+119
-3
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222
[submodule "go-runner/testdata/projects/cli-runtime"]
2323
path = go-runner/testdata/projects/cli-runtime
2424
url = https://github.com/kubernetes/cli-runtime.git
25+
[submodule "go-runner/testdata/projects/caddy"]
26+
path = go-runner/testdata/projects/caddy
27+
url = https://github.com/caddyserver/caddy

go-runner/src/integration_tests.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ fn assert_results_snapshots(profile_dir: &Path, project_name: &str) {
6363
}
6464

6565
#[rstest]
66-
// // #[case::caddy("caddy")]
66+
// The 'BenchmarkMatchExpressionMatch/boolean_matches_succeed_for_placeholder_http.request.tls.client.subject-16' benchmark currently
67+
// panics, which causes the binary (which contains more benchmarks) to exit. Has to be fixed within Caddy.
68+
#[case::caddy("caddy")]
6769
#[case::fzf("fzf")]
6870
#[case::opentelemetry_go("opentelemetry-go")]
6971
#[case::golang_benchmarks("golang-benchmarks")]

go-runner/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@ pub fn run_benchmarks<P: AsRef<Path>>(
4747
}
4848
};
4949

50-
runner::run(
50+
if let Err(error) = runner::run(
5151
&binary_path,
5252
&["-test.bench", &cli.bench, "-test.benchtime", &cli.benchtime],
53-
)?;
53+
) {
54+
error!("Failed to run benchmarks for {}: {error}", package.name);
55+
continue;
56+
}
5457
}
5558

5659
// 3. Collect the results
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
source: go-runner/src/integration_tests.rs
3+
expression: results
4+
---
5+
[
6+
{
7+
"creator": {
8+
"name": "codspeed-go",
9+
"version": "[version]",
10+
"pid": "[pid]"
11+
},
12+
"instrument": {
13+
"type": "walltime"
14+
},
15+
"benchmarks": [
16+
{
17+
"name": "BenchmarkLoad",
18+
"uri": "admin_test.go::BenchmarkLoad",
19+
"config": {
20+
"warmup_time_ns": null,
21+
"min_round_time_ns": null,
22+
"max_time_ns": null,
23+
"max_rounds": null
24+
},
25+
"stats": "[stats]"
26+
},
27+
{
28+
"name": "BenchmarkReplacer::escaped_placeholder",
29+
"uri": "replacer_test.go::BenchmarkReplacer::escaped_placeholder",
30+
"config": {
31+
"warmup_time_ns": null,
32+
"min_round_time_ns": null,
33+
"max_time_ns": null,
34+
"max_rounds": null
35+
},
36+
"stats": "[stats]"
37+
},
38+
{
39+
"name": "BenchmarkReplacer::int_replacement",
40+
"uri": "replacer_test.go::BenchmarkReplacer::int_replacement",
41+
"config": {
42+
"warmup_time_ns": null,
43+
"min_round_time_ns": null,
44+
"max_time_ns": null,
45+
"max_rounds": null
46+
},
47+
"stats": "[stats]"
48+
},
49+
{
50+
"name": "BenchmarkReplacer::no_placeholder",
51+
"uri": "replacer_test.go::BenchmarkReplacer::no_placeholder",
52+
"config": {
53+
"warmup_time_ns": null,
54+
"min_round_time_ns": null,
55+
"max_time_ns": null,
56+
"max_rounds": null
57+
},
58+
"stats": "[stats]"
59+
},
60+
{
61+
"name": "BenchmarkReplacer::placeholder",
62+
"uri": "replacer_test.go::BenchmarkReplacer::placeholder",
63+
"config": {
64+
"warmup_time_ns": null,
65+
"min_round_time_ns": null,
66+
"max_time_ns": null,
67+
"max_rounds": null
68+
},
69+
"stats": "[stats]"
70+
},
71+
{
72+
"name": "BenchmarkReplacer::string_replacement",
73+
"uri": "replacer_test.go::BenchmarkReplacer::string_replacement",
74+
"config": {
75+
"warmup_time_ns": null,
76+
"min_round_time_ns": null,
77+
"max_time_ns": null,
78+
"max_rounds": null
79+
},
80+
"stats": "[stats]"
81+
}
82+
]
83+
},
84+
{
85+
"creator": {
86+
"name": "codspeed-go",
87+
"version": "[version]",
88+
"pid": "[pid]"
89+
},
90+
"instrument": {
91+
"type": "walltime"
92+
},
93+
"benchmarks": [
94+
{
95+
"name": "BenchmarkOpenResponseWriter",
96+
"uri": "modules/caddyhttp/encode/encode_test.go::BenchmarkOpenResponseWriter",
97+
"config": {
98+
"warmup_time_ns": null,
99+
"min_round_time_ns": null,
100+
"max_time_ns": null,
101+
"max_rounds": null
102+
},
103+
"stats": "[stats]"
104+
}
105+
]
106+
}
107+
]

go-runner/testdata/projects/caddy

Submodule caddy added at 551f793

0 commit comments

Comments
 (0)