chore(test): migrate to tasty-discover Flavored API for platform-specific test filtering #1258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog
Motivation
Background: Platform-Specific Testing Challenges
The cardano-cli help text tests needed to be skipped on Windows because the CLI executable has platform-specific differences in its output:
cardano-clicardano-cli.exePrevious Approach (Manual Runtime Check)
The old implementation used a manual runtime platform check:
Problems with this approach:
Hedgehog.Extras.Stock.OS (isWin32)for platform detectionNew Approach (Flavored API with Platform Filter)
The new implementation uses tasty-discover's
Flavoredtype andplatformfunction:Benefits:
"!windows"is expressed declaratively!,&,|operators)[SKIPPED]in yellow in test outputtasty_prefix (vstest_) signals that this test uses the custom Tasty instance mechanism, which is appropriate for Flavored transformationsFlavoredisIO TestTreeso the test monad hasn't changed for the actual test.Additional Context from tasty-discover 5.1.0
The tasty-discover 5.1.0 release added:
platformfunction and logical expressionsFlavoredtype for general-purpose test transformations with extensible design"!windows","linux | darwin","!windows & !darwin"The
Flavoredpattern is designed to be extensible for future use cases like:Context
This PR upgrades the test infrastructure to use the newer tasty-discover API with Flavored test support. The key changes include:
tasty-discoverdependency to the cardano-cli-golden test suitetest_*naming convention totasty_*with the newFlavoredAPI for platform-specific test filteringThe migration replaces the manual platform check (
isWin32) with the cleanerflavored (platform "!windows")API, which provides better declarative platform filtering. Tests are conditionally executed based on platform constraints, preserving the existing behavior of skipping help text tests on Windows due to platform-specific output differences (e.g., cardano-cli.exe vs cardano-cli).How to trust this PR
To verify this change works correctly:
cabal build all --enable-testscabal test cardano-cli-golden --enable-testsThe tests should pass with the same coverage as before, but now use the updated test discovery mechanism with cleaner platform filtering.
Checklist