Skip to content

Commit 96570d8

Browse files
andy-tier1appclaude
andcommitted
Clean up zip test and restore full CI test suite
- Removed debug logging from TestZipFolder - Restored full test suite in CI workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 398aa22 commit 96570d8

File tree

2 files changed

+12
-33
lines changed

2 files changed

+12
-33
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,13 @@ jobs:
118118

119119
- name: Run tests with coverage (excluding CGO-dependent packages)
120120
run: |
121-
# TEMP: Run only zip test for debugging
122-
go test -v -race ./internal/agent/ondemand/... -run TestZipFolder
123-
124-
# TEMP: Skipping coverage summary while debugging zip test
125-
# - name: Display coverage summary
126-
# run: |
127-
# go tool cover -func=coverage.out | tail -20
128-
# echo ""
129-
# echo "=== Total Coverage ==="
130-
# go tool cover -func=coverage.out | grep total
121+
go test -v -race -coverprofile=coverage.out -covermode=atomic $(go list ./... | grep -v 'internal/cli' | grep -v 'internal/capture/procps/linux')
122+
123+
- name: Display coverage summary
124+
run: |
125+
go tool cover -func=coverage.out | tail -20
126+
echo ""
127+
echo "=== Total Coverage ==="
128+
go tool cover -func=coverage.out | grep total
131129
132130

internal/agent/ondemand/zip_test.go

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,13 @@ func TestZipFolder(t *testing.T) {
1515
}
1616
defer os.RemoveAll(tempDir)
1717

18-
t.Logf("DEBUG: Created temp dir: %s", tempDir)
19-
2018
// Create a test folder inside temp dir
2119
testFolder := filepath.Join(tempDir, "testfolder")
22-
err = os.Mkdir(testFolder, 0755)
23-
if err != nil {
20+
if err := os.Mkdir(testFolder, 0755); err != nil {
2421
t.Fatalf("Failed to create test folder: %v", err)
2522
}
26-
t.Logf("DEBUG: Created test folder: %s", testFolder)
2723

28-
// Create some test files
24+
// Create test files
2925
testFiles := []struct {
3026
name string
3127
content string
@@ -37,11 +33,9 @@ func TestZipFolder(t *testing.T) {
3733

3834
for _, tf := range testFiles {
3935
filePath := filepath.Join(testFolder, tf.name)
40-
err = os.WriteFile(filePath, []byte(tf.content), 0644)
41-
if err != nil {
36+
if err := os.WriteFile(filePath, []byte(tf.content), 0644); err != nil {
4237
t.Fatalf("Failed to create test file %s: %v", tf.name, err)
4338
}
44-
t.Logf("DEBUG: Created test file: %s", filePath)
4539
}
4640

4741
// Change to temp dir so the zip is created there
@@ -51,25 +45,21 @@ func TestZipFolder(t *testing.T) {
5145
}
5246
defer os.Chdir(originalDir)
5347

54-
err = os.Chdir(tempDir)
55-
if err != nil {
48+
if err := os.Chdir(tempDir); err != nil {
5649
t.Fatalf("Failed to change to temp dir: %v", err)
5750
}
58-
t.Logf("DEBUG: Changed to dir: %s", tempDir)
5951

6052
// Call ZipFolder with the relative path
6153
zipName, err := ZipFolder("testfolder")
6254
if err != nil {
6355
t.Fatalf("ZipFolder failed: %v", err)
6456
}
65-
t.Logf("DEBUG: Created zip file: %s", zipName)
6657

6758
// Verify the zip file was created
6859
zipPath := filepath.Join(tempDir, zipName)
6960
if _, err := os.Stat(zipPath); os.IsNotExist(err) {
7061
t.Fatalf("Zip file was not created at %s", zipPath)
7162
}
72-
t.Logf("DEBUG: Verified zip exists at: %s", zipPath)
7363

7464
// Open and verify the zip contents
7565
reader, err := zip.OpenReader(zipPath)
@@ -78,16 +68,7 @@ func TestZipFolder(t *testing.T) {
7868
}
7969
defer reader.Close()
8070

81-
t.Logf("DEBUG: Zip contains %d files", len(reader.File))
82-
for _, f := range reader.File {
83-
t.Logf("DEBUG: Zip entry: %s (size: %d)", f.Name, f.UncompressedSize64)
84-
}
85-
86-
// Verify all test files are in the zip
8771
if len(reader.File) != len(testFiles) {
8872
t.Errorf("Expected %d files in zip, got %d", len(testFiles), len(reader.File))
8973
}
90-
91-
// Cleanup the zip file
92-
os.Remove(zipPath)
9374
}

0 commit comments

Comments
 (0)