Add featureflags interface for testing
The following discussion from !1369 (merged) should be addressed:
-
@steveazz started a discussion: (+2 comments) Is there any particular reason why we created
getFeatureFlags
? I see that we are using this for the test inside ofTestAllowToOverwriteFeatureFlagWithRunnerVariables
to me that is specific forcommon/build_test.go
andTestAllowToOverwriteFeatureFlagWithRunnerVariables
it's not something that the rest of the application should know about. Looking at the new func infeatureflags
package I would move that tocommon
package since it's specifically for testing. Also like this, we are introducing globals which are never ideal in most cases, especially since we are updating it during tests this can lead to flaky tests.. I think wefeatureflags
should define an interface that build so then we can mock it properly.So I suggest the following:
- For this MR just use another FF that will be around longer than %12.0 just for the
TestAllowToOverwriteFeatureFlagWithRunnerVariables
test - Create a follow-up ~"technical debt" MR which will introduce this interface and update the test with mocks.
WDYT?
- For this MR just use another FF that will be around longer than %12.0 just for the