Skip to content

Commit 7c212cb

Browse files
committed
chore: minor changes
1 parent c3d054b commit 7c212cb

7 files changed

Lines changed: 35 additions & 13 deletions

File tree

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@
1010
[submodule "go-runner/testdata/projects/caddy"]
1111
path = go-runner/testdata/projects/caddy
1212
url = https://github.com/caddyserver/caddy
13+
[submodule "go-runner/testdata/projects/fuego"]
14+
path = go-runner/testdata/projects/fuego
15+
url = https://github.com/go-fuego/fuego
16+
[submodule "go-runner/testdata/projects/hugo"]
17+
path = go-runner/testdata/projects/hugo
18+
url = https://github.com/gohugoio/hugo/

example/fib_test.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ package example
33
import "testing"
44

55
func BenchmarkFibonacci10(b *testing.B) {
6-
for i := 0; i < b.N; i++ {
7-
fibonacci(10)
8-
}
6+
b.Run("fibonacci(10)", func(b *testing.B) {
7+
b.Run("fibonacci(10)", func(b *testing.B) {
8+
for i := 0; i < b.N; i++ {
9+
fibonacci(10)
10+
}
11+
})
912

10-
b.Run("fibonacci(40)", func(b *testing.B) {
11-
for i := 0; i < b.N; i++ {
12-
fibonacci(10)
13-
}
1413
})
1514
}
1615

go-runner/src/builder/discovery.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ fn discover_benchmarks(packages: Vec<GoPackage>) -> anyhow::Result<HashMap<Strin
241241
.map(has_test_files)
242242
.unwrap_or_default();
243243
if !has_tests {
244+
debug!("Skipping package without test files: {}", package.name);
244245
continue;
245246
}
246247

@@ -251,18 +252,30 @@ fn discover_benchmarks(packages: Vec<GoPackage>) -> anyhow::Result<HashMap<Strin
251252
.map(has_test_imports)
252253
.unwrap_or_default();
253254
if !has_test_imports {
255+
debug!("Skipping package without test imports: {}", package.name);
254256
continue;
255257
}
256258

257259
// Only include test executables, since we want to generate them manually.
258260
// Example format: `local.dev/example-complex [local.dev/example-complex.test]`
259261
if !package.import_path.ends_with(".test]") {
262+
debug!("Skipping package without test executable: {}", package.name);
260263
continue;
261264
}
262265

263266
// Skip packages that don't have benchmarks
264-
let benchmarks = package.benchmarks()?;
267+
let benchmarks = match package.benchmarks() {
268+
Ok(benchmarks) => benchmarks,
269+
Err(e) => {
270+
warn!(
271+
"Failed to get benchmarks for package {}: {}",
272+
package.name, e
273+
);
274+
continue;
275+
}
276+
};
265277
if benchmarks.is_empty() {
278+
debug!("Skipping package without benchmarks: {}", package.name);
266279
continue;
267280
}
268281

go-runner/src/integration_tests.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,17 @@ fn assert_benchmarks_created(binary_dir: &Path, n: usize) {
2727
}
2828

2929
#[rstest]
30-
// #[case("caddy")]
31-
#[case("fzf")]
32-
#[case("opentelemetry-go")]
33-
#[case("golang-benchmarks")]
30+
// #[case::caddy("caddy")]
31+
// #[case::hugo("hugo")]
32+
#[case::fzf("fzf")]
33+
#[case::opentelemetry_go("opentelemetry-go")]
34+
#[case::golang_benchmarks("golang-benchmarks")]
35+
#[case::fuego("fuego")]
3436
fn test_build_and_run(#[case] project_name: &str) {
3537
let temp_dir = setup_test_project(project_name).unwrap();
3638

3739
let binary_dir = temp_dir.path().join(".codspeed").join("walltime");
3840
let binaries = crate::build_benchmarks(temp_dir.path(), &binary_dir).unwrap();
39-
assert!(!binaries.is_empty(), "No benchmark binaries were created");
4041
assert_benchmarks_created(&binary_dir, binaries.len());
4142

4243
// Mutex to prevent concurrent tests from interfering with CODSPEED_PROFILE_FOLDER env var
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 4ef9d6338b9285c7945a2d6bd04a2d28781fa175

go-runner/testdata/projects/fuego

Submodule fuego added at 15bb3a7

go-runner/testdata/projects/hugo

Submodule hugo added at 3aa22b0

0 commit comments

Comments
 (0)