-
Notifications
You must be signed in to change notification settings - Fork 24
Standardize the file and dir mode for context test #1852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughTests updated to set up a local Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.5.0)level=warning msg="[linters_context] running gomodguard failed: unable to read module file go.mod: current working directory must have a go.mod file: if you are not using go modules it is suggested to disable this linter" Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/pkg/cli/compose/context_test.go`:
- Line 19: Remove the unused import "github.com/DefangLabs/defang/src/pkg/term"
(the symbol term) from the import block in the test file so the package builds
cleanly; locate the import statement referencing term in context_test.go and
delete that import entry (or reformat the import block to only include used
packages).
🧹 Nitpick comments (1)
src/pkg/cli/compose/context_test.go (1)
256-259: Consider restoring original permissions witht.Cleanup.Calling
standardizeDirModeon the actual testdata directory modifies repository files permanently. This could leave the repo in a modified state after tests run (git may show permission changes). Consider saving and restoring original permissions, or copying the testdata to a temp directory first.Option: Use a temp directory copy
// Copy testdata to temp dir to avoid modifying repo files context := t.TempDir() if err := copyDir("../../../testdata/testproj", context); err != nil { t.Fatalf("Failed to copy testdata: %v", err) } if err := standardizeDirMode(context); err != nil { t.Fatalf("Failed to standardize directory modes: %v", err) }
Description
So the compose test would run consistently irrespective what is the default folder mode of the checked out source code.
Checklist
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.