MCPcopy Create free account
hub / github.com/github/gh-aw / BenchmarkExtractWorkflowNameFromFile

Function BenchmarkExtractWorkflowNameFromFile

pkg/cli/commands_utils_test.go:324–344  ·  view source on GitHub ↗

Benchmark tests

(b *testing.B)

Source from the content-addressed store, hash-verified

322
323// Benchmark tests
324func BenchmarkExtractWorkflowNameFromFile(b *testing.B) {
325 // Create temporary test file
326 tmpDir := b.TempDir()
327 content := `---
328title: Test Workflow
329---
330
331# Daily Test Coverage Improvement
332
333This is a test workflow with some content.`
334
335 filePath := filepath.Join(tmpDir, "test-workflow.md")
336 err := os.WriteFile(filePath, []byte(content), 0644)
337 if err != nil {
338 b.Fatalf("Failed to create test file: %v", err)
339 }
340
341 for b.Loop() {
342 _, _ = extractWorkflowNameFromFile(filePath)
343 }
344}
345
346func BenchmarkFindIncludesInContent(b *testing.B) {
347 content := `This is content with includes:

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected