makerdao / spells-mainnet

Staging repo for MakerDAO weekly executive spells
GNU Affero General Public License v3.0
123 stars 51 forks source link

refactor: standarize testing for dai and mkr actions [PoC] #376

Closed wei3erHase closed 1 month ago

wei3erHase commented 11 months ago

This PR adds another PoC, in the same rationale of #375, but for more common actions such as DAI and MKR streams, payments, and yanks. The ultimate goal is to reduce what developer needs to touch in DssSpell.t.sol, and move the common actions (such as payments) to a separate and more auditable testing file, while avoiding disabling and enabling tests that are crucial for the correct check on these actions.

The workflow checks (same as previous tests):

The advantages of this process rationale:

Given that previous spell has no MKR payments or yanks, the test output looks like this:

image

As you replied in #375, the rule of thumb is to make tests as simple as possible, i agree, there's little advantage in that one (as it touches the changelog, and perhaps needs other process), but perhaps this approach on very common tasks could be a bit more beneficial for the testing process.