mlswg / mls-implementations

Coordination of implementation and interop specific details
109 stars 14 forks source link

Refactor test runner steps to be more reusable #143

Open bifurcation opened 1 year ago

bifurcation commented 1 year ago

Right now, all the interesting logic in test-runner.go is in one big switch statement in RunStep. This makes it basically impossible for compound steps to call through to individual steps. For example, fullCommit could in principle call through to commit, handlePendingCommit, handleCommit, and joinGroup, but instead it replicates all the logic of those methods.

bifurcation commented 1 year ago

One thing that might be helpful here is to leverage the Go type system more, for example by decoding script steps into typed values. Then you could have a bunch of RunFooStep(step FooStep) methods that would presumably be easier to chain.