Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding user command integration tests to github CI workflow. #282

Conversation

bdchatham
Copy link
Contributor

Overview

Adding user command integration tests to github CI workflow. These test suites use bats. This provides a simple testing framework for managing individual tests, output and assertions. This CI workflow runs against the Anvil environment.

Testing

These commands were tested throughout the week against EigenLayer slashing/uam contracts in personal, preprod and testnet environments.

Why bats & Other Options

Bats is a lean testing framework that allows us to dog food the entire e2e experience of our customers using the CLI.

It is fairly straightforward to run integration tests in Go, triggered as a CI task via a dockerfile, for example. While this would work well, and be nice for development, the concern is having gaps in the CX (although very small) and complexity working directly with command printed output. Again, all possible to do but chose this route for full dogfooding benefit.

This is not a one-way door. We can pivot to using Golang testing if bash scripting of the CLI binary is cumbersome unnecessary.

Standardization

I'd like to see us continue to expand on this testing iteratively for other commands and make it required to add tests like these for any net-new commands.

What Changed?

  • User integration tests added to GitHub CI workflow.
  • Invokes tests from a root-command level runner.
  • Tests verify:
    • command outputs via stdout
    • command response codes
    • calldata output file creation
    • contract state

@bdchatham bdchatham merged commit 435756e into Layr-Labs:madhur/slashing-allocations Dec 21, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants