Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Replace diff test in abi-gen with CI check #2012

Closed
xianny opened this issue Jul 30, 2019 · 0 comments · Fixed by #2079
Closed

Replace diff test in abi-gen with CI check #2012

xianny opened this issue Jul 30, 2019 · 0 comments · Fixed by #2079

Comments

@xianny
Copy link
Contributor

xianny commented Jul 30, 2019

Current Behavior

abi-gen currently has a copy of generated code checked in at abi-gen/test-cli/expected-output. The yarn build step for this package will generate fresh code at abi-gen/test-cli/output (gitignored) and fail a test if it differs from the expected-output. Devs have to manually copy output to expected-output when making any changes that ripple through the generated output. This results in annoying CI failures unless devs are familiar with the unusual workflow.

Possible Solution

Get rid of the expected-output folder. Remove output from gitignore. The build step will continue to update output and keep it in sync with any generator changes. Unit tests continue to rely on output.

Add a CI step after building that compares freshly generated code to the output folder at the current commit.
abi-gen$ git diff test-cli/output
If there are diffs, it fails. This enforces that changes to generator and generated are always in sync, even if devs deviate from the yarn build workflow, e.g. by manually generating wrappers.

Devs should manually review changes to output in their PRs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants