TestDeleteContext fails because it uses a brittle relative path
Summary
TestDeleteContext in cmd/context_test.go writes its fixture to ./testdata/local.config.
That path depends on the current working directory, so the test fails when it is not run from the package folder.
Error
open ./testdata/local.config: no such file or directory
Expected Behavior
The test should create and use an isolated temporary file path so it does not depend on where the test is launched from.
Actual Behavior
TestDeleteContext fails when the working directory does not contain ./testdata/local.config.
Suggested Fix
Use t.TempDir() to create the config file in a temporary directory, then pass that absolute path through the test instead of using a hardcoded relative path.
Example approach:
tempDir := t.TempDir()
configPath := filepath.Join(tempDir, "local.config")
Acceptance Criteria
Additional Context
This issue makes the test suite less portable and can cause failures in CI environments or when running tests from different directories.
TestDeleteContext fails because it uses a brittle relative path
Summary
TestDeleteContextincmd/context_test.gowrites its fixture to./testdata/local.config.That path depends on the current working directory, so the test fails when it is not run from the package folder.
Error
Expected Behavior
The test should create and use an isolated temporary file path so it does not depend on where the test is launched from.
Actual Behavior
TestDeleteContextfails when the working directory does not contain./testdata/local.config.Suggested Fix
Use
t.TempDir()to create the config file in a temporary directory, then pass that absolute path through the test instead of using a hardcoded relative path.Example approach:
Acceptance Criteria
cmdpackage../testdata/local.config.Additional Context
This issue makes the test suite less portable and can cause failures in CI environments or when running tests from different directories.