Skip to content

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

Open
@jpmcb

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions