Reason/Context
Currently, TestDeleteContext in cmd/context_test.go relies on a hardcoded file path
/testdata/local.config
This approach causes the test to fail on filesystems that do not fully
support Unix-style permissions (such as NTFS or FAT32 partitions commonly used on external drives or
Windows-mounted volumes), as the test attempts to verify restrictive file permissions (0600).
Description
The enhancement involves refactoring the TestDeleteContext function. Instead of using a static file
path, the test will now:
- Utilize
t.TempDir() to create a unique, isolated directory for each test run.
- Construct the configuration file path dynamically using f
ilepath.Join()
- Clean up automatically after the test finishes, as
t.TempDir() is managed by the Go testing
package.
Implementation ideas
No response
Reason/Context
Currently,
TestDeleteContextincmd/context_test.gorelies on a hardcoded file path/testdata/local.configThis approach causes the test to fail on filesystems that do not fully
support Unix-style permissions (such as NTFS or FAT32 partitions commonly used on external drives or
Windows-mounted volumes), as the test attempts to verify restrictive file permissions (0600).
Description
The enhancement involves refactoring the
TestDeleteContextfunction. Instead of using a static filepath, the test will now:
t.TempDir()to create a unique, isolated directory for each test run.ilepath.Join()t.TempDir()is managed by the Go testingpackage.
Implementation ideas
No response