Can specific fitnesse tests be toggled on or off conditionally?
In Fowler/Hodgson terminology, we are using "Release Toggles" - i.e. toggles which allow changes to be disabled in our test and pro environment until ready for prime time. We don't want failures in these features to affect the shipment to pro so aren't interested in the results of those tests. In that sense, the CDP pipeline has the toggles set to "PRO" configuration all the way through to keep the acceptance tests fast and focused. So how to get fitnesse to ignore the tests related to the toggle?
I see this related answer: How should feature toggles be set in tests run in continuous integration? which indicates that this user tests all sides of the toggles, but this is not usually possible for us - e.g. imagine that a feature requires an application restart to change the toggle due to DI or whatever (e.g. because the feature requires wiring a different web controller) - this is a pretty hard thing for fitnesse to do.. makes for slow tests and is testing functionality we don't actually need to test (yet).
So we want to be able to develop the feature (behind a toggle) and the tests, fixtures (marked with the same toggle) and when we are ready to enable them flick them on to run through the CI pipeline. Something like:
- Decide feature needs a toggle so create one TOG123-change-api-behaviour
- Add the toggle to the central toggle system which all code can see
- Set toggle to "false" in configuration for CI environments
- Develop feature and fitnesse tests behind toggling code
- When ready to CDP set to true
- When passing test, ship to pro
- in time.. remove the toggle by literally searching for TOG123 and cleaning up the mess..
The bit I don't see a good answer for is how to guard specific fitnesse tests with conditions (i.e. the new test would have a when: TOG123.enabled and the old test would have a when: TOG123.disabled). Fitnesse seems a tad.. awkward to me. Are tags what I'm looking for? Suites seem too broad a level..