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/super-linter.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkg/cli/compile_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ func TestMain(m *testing.M) {
os.RemoveAll(filepath.Dir(globalBinaryPath))
}

// Clean up any action cache files created during tests
// Tests may create .github/aw/actions-lock.json in the pkg/cli directory
actionCacheDir := filepath.Join(wd, ".github")
if _, err := os.Stat(actionCacheDir); err == nil {
_ = os.RemoveAll(actionCacheDir)
}

os.Exit(code)
}

Expand Down
31 changes: 31 additions & 0 deletions pkg/cli/test_main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//go:build !integration

package cli

import (
"os"
"path/filepath"
"testing"
)

// TestMain provides setup and teardown for unit tests in the cli package
// Note: Integration tests have their own TestMain in compile_integration_test.go
func TestMain(m *testing.M) {
// Get current working directory before tests run
wd, err := os.Getwd()
if err != nil {
panic("Failed to get current working directory: " + err.Error())
}

// Run all tests
code := m.Run()

// Clean up any action cache files created during tests
// Tests may create .github/aw/actions-lock.json in the pkg/cli directory
actionCacheDir := filepath.Join(wd, ".github")
if _, err := os.Stat(actionCacheDir); err == nil {
_ = os.RemoveAll(actionCacheDir)
}

os.Exit(code)
}
Loading