DEV Community

Discussion on: Feature flags and waffles

Collapse
 
autoferrit profile image
Shawn McElroy

I would guess that you can handle the flags in the same way as the tests. Master branch would alwaysbtesr against the main code. If a flag wasn't made right that should break production and a test will fail. As it should.

Presumably your tests at least know some basics about toggling feature flags maybe using parameterization. After all testing the new features will get merged into the main tests anyways when they're done. So just like the site when the flags go away the tests will have the code for the new features.

Collapse
 
mblayman profile image
Matt Layman

Yeah, good point. I didn't mention it in the article, but Django Waffle has some nice utilities for decorating test methods so it's quick to write tests with flags in on (and off!) states. I use these kinds of utilities at work all the time.