Skip to content
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

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

Open
jpmcb opened this issue Sep 12, 2024 · 0 comments
Open
Labels

Comments

@jpmcb
Copy link
Member

jpmcb commented Sep 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant