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

dapp-tests: use bash_unit as a test runner #797

Merged
merged 4 commits into from
Sep 21, 2021
Merged

dapp-tests: use bash_unit as a test runner #797

merged 4 commits into from
Sep 21, 2021

Conversation

d-xo
Copy link
Contributor

@d-xo d-xo commented Sep 15, 2021

Description

Makes use of bash_unit as a unit test runner for the dapp_tests. This makes working with these tests a little more ergonomic and means we can:

  • esaily run a subset of the tests
  • have slightly more readable assertions
  • get clearer error messages when an assertion does not hold

If you want to hack on the tests, you can cd into src/dapp-tests and entering the nix-shell. From there you can run bash_unit integeration/tests.sh. To run a subset of the tests, you can run bash_unit -p <REGEX> integration/tests.sh.

I also refactored a little bit, and now the tests are organised so that there is a shared instance of dapp testnet running in the background for every test, as well as a helper function fresh_account that generates and funds a new address.

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

@d-xo
Copy link
Contributor Author

d-xo commented Sep 21, 2021

wrote a mini fuzz testing framework and fuzzed a few easy roundtrip properties. Found a bug in --from-fix, and another in --to-fix.

@d-xo d-xo merged commit 4f40b0c into master Sep 21, 2021
@d-xo d-xo deleted the fancy-tests branch September 21, 2021 19:41
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.

None yet

1 participant