IntersectMBO / IntersectMBO/ouroboros-consensus

Test backwards compatibility in golden tests

Open
#621 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
67
Forks
43
Avg merge
5d 13h
Merged PRs (30d)
43

Description

Our golden tests check whether encoding the example value still gives the same expected bytes.

Sometimes we change the encoding format of, e.g., the ledger state, but make the decoder backwards compatible with the old format (we use [`Ouroboros.Consensus.Util.Versioned`](https://github.com/input-output-hk/ouroboros-network/blob/3d990f8358dd500f78e2932e1a6ace9d5b982650/ouroboros-consensus/src/Ouroboros/Consensus/Util/Versioned.hs) for that when possible). See [this example](https://github.com/input-output-hk/ouroboros-network/blob/3d990f8358dd500f78e2932e1a6ace9d5b982650/ouroboros-consensus-shelley/src/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs#L527-L533). It would be good to test this using the existing golden test infrastructure we have. In the test, we would check whether decoding the old bytestring still results in the same example value.

Contributor guide

Open the contributing guide

Research direction

Start by examining the existing golden test infrastructure and the Versioned.hs utility linked in the issue, then compare the compatibility example in Shelley/Ledger/Ledger.hs. Add coverage that decodes the old bytestring and verifies it produces the same example value.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.