Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
runs-on: codspeed-macro
strategy:
matrix:
target: [example, example/compat, example/timing, example/very/nested/module]
target: [example, example/compat, example/timing, example/very/nested/module, example/external]
steps:
- uses: actions/checkout@v4
with:
Expand Down
15 changes: 15 additions & 0 deletions example/external/external_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// This file uses the _test package suffix, which is a common Go pattern
// for black-box testing. This tests the public API of the math package
// without accessing internal implementation details.
package external_test

import (
"example"
"testing"
)

func BenchmarkExternalFib(b *testing.B) {
for i := 0; i < b.N; i++ {
example.Fibonacci(5)
}
}
2 changes: 2 additions & 0 deletions example/fib.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ func fibonacci(n int) int {
}
return fibonacci(n-1) + fibonacci(n-2)
}

var Fibonacci = fibonacci
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,19 @@ expression: packages
}
]
},
{
"raw_package": "[raw_package]",
"benchmarks": [
{
"name": "BenchmarkExternalFib",
"module_path": "example/external",
"import_alias": "benchmarkexternalfib_8141020470883116639",
"qualified_name": "benchmarkexternalfib_8141020470883116639.BenchmarkExternalFib",
"file_path": "external/external_test.go",
"is_external": true
}
]
},
{
"raw_package": "[raw_package]",
"benchmarks": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ expression: results
"benchmarks": [
{
"name": "BenchmarkAdd",
"uri": "go-runner/testdata/projects/example-with-test-package/codspeed/math_test.go::BenchmarkAdd",
"uri": "go-runner/testdata/projects/example-with-test-package/math_test.go::BenchmarkAdd",
"config": {
"warmup_time_ns": null,
"min_round_time_ns": null,
Expand All @@ -26,7 +26,7 @@ expression: results
},
{
"name": "BenchmarkMultiply",
"uri": "go-runner/testdata/projects/example-with-test-package/codspeed/math_test.go::BenchmarkMultiply",
"uri": "go-runner/testdata/projects/example-with-test-package/math_test.go::BenchmarkMultiply",
"config": {
"warmup_time_ns": null,
"min_round_time_ns": null,
Expand Down Expand Up @@ -106,7 +106,7 @@ expression: results
"benchmarks": [
{
"name": "BenchmarkFibonacci20",
"uri": "go-runner/testdata/projects/example-with-test-package/fib_external/codspeed/fib_integration_test.go::BenchmarkFibonacci20",
"uri": "go-runner/testdata/projects/example-with-test-package/fib_external/fib_integration_test.go::BenchmarkFibonacci20",
"config": {
"warmup_time_ns": null,
"min_round_time_ns": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,29 @@ expression: results
}
]
},
{
"creator": {
"name": "codspeed-go",
"version": "[version]",
"pid": "[pid]"
},
"instrument": {
"type": "walltime"
},
"benchmarks": [
{
"name": "BenchmarkExternalFib",
"uri": "example/external/external_test.go::BenchmarkExternalFib",
"config": {
"warmup_time_ns": null,
"min_round_time_ns": null,
"max_time_ns": null,
"max_rounds": null
},
"stats": "[stats]"
}
]
},
{
"creator": {
"name": "codspeed-go",
Expand Down
Loading
Loading