pizza-cli icon indicating copy to clipboard operation
pizza-cli copied to clipboard

Bug: config tests do not account for developer's home `~/.sauced.yaml` config

Open jpmcb opened this issue 5 months ago • 0 comments

Describe the bug

There are still flakey tests:

--- FAIL: TestLoadConfig (0.00s)
    --- FAIL: TestLoadConfig/Non-existent_file (0.00s)
        config_test.go:51:
                Error Trace:    /Users/jpmcb/workspace/opensauced/pizza-cli/pkg/config/config_test.go:51
                Error:          An error is expected but got nil.
                Test:           TestLoadConfig/Non-existent_file

which do not account for a developer's home ~/.sauced.yaml

Steps to reproduce

  1. Create a home ~/.sauced.yaml
  2. Run tests via just test
  3. See ^ test fail

This is fixed by moving the home config:

❯ mv ~/.sauced.yaml ~/.meow.yaml

Tests should not make an assumption based on the developer's environment. These kind of tests would be better in isolated e2e tests.

jpmcb avatar Sep 12 '24 17:09 jpmcb