sbtc-developer-release icon indicating copy to clipboard operation
sbtc-developer-release copied to clipboard

Integration tests with devenv as backend.

Open CAGS295 opened this issue 1 year ago • 8 comments

Summary of Changes

  • File structure for integration tests.
  • Ignore integration files in coverage.
  • Let docker assign ports and container names.
  • Deploy contracts.
  • Add a Readme.
  • Add a weak test for broadcasting deposits.

Testing

Replicate behavior in deposit.sh

Risks

Low risk, break devenv due to changes in configuration.

How were these changes tested?

Manual testing of the integration pipeline. Follow the Readme to replicate.

What future testing should occur?

The tests I included are not complete. I don't assert on pre and post-conditions. In another PR we need to enable integration CI and finish the tests.

Checklist:

  • [X] My code follows the style guidelines of this project
  • [X] I have performed a self-review of my code
  • [X] I have commented my code, particularly in hard-to-understand areas
  • [X] I have made corresponding changes to the documentation
  • [X] My changes generate no new warnings
  • [X] I have added tests that prove my fix is effective or that my feature works
  • [X] New and existing unit tests pass locally with my changes
  • [X] Any dependent changes have been merged and published in downstream modules

CAGS295 avatar Oct 04 '23 07:10 CAGS295

Codecov Report

Attention: 76 lines in your changes are missing coverage. Please review.

Comparison is base (6470223) 43.44% compared to head (e07fd1c) 43.01%. Report is 4 commits behind head on main.

Files Patch % Lines
romeo/src/stacks_client.rs 0.00% 36 Missing :warning:
sbtc-cli/src/main.rs 0.00% 14 Missing :warning:
stacks-core/src/address.rs 0.00% 13 Missing :warning:
sbtc-cli/src/commands/deposit.rs 0.00% 10 Missing :warning:
sbtc-cli/src/commands/broadcast.rs 0.00% 2 Missing :warning:
romeo/src/system.rs 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #215      +/-   ##
==========================================
- Coverage   43.44%   43.01%   -0.43%     
==========================================
  Files          45       45              
  Lines        5467     5521      +54     
  Branches       47       47              
==========================================
  Hits         2375     2375              
- Misses       3091     3145      +54     
  Partials        1        1              
Flag Coverage Δ
unittests 76.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 04 '23 07:10 codecov[bot]

@friedger Almost there. I just added clarinet deployments. I may add a deposit or withdrawal test tomorrow based on the script you shared a few days ago.

CAGS295 avatar Oct 04 '23 07:10 CAGS295

Where would I see the result of the test?

friedger avatar Oct 06 '23 15:10 friedger

When you run the tests. You will see the container id such as:

with container id: ead4e29d30292d22d96d2f13e2be183b6e49d8a9a0d87a6f752a5c144d096ad4

You can use the container id with devenv/logs.sh

I recommend another terminal watching specific services or the testing container itself while you wait for it to finish.

devenv$ ./log.sh ead4e29d30292d22d96d2f13e2be183b6e49d8a9a0d87a6f752a5c144d096ad4

If the tests fails the script will print the logs for you, which is the case so far ^^.

CAGS295 avatar Oct 06 '23 21:10 CAGS295

Changing devenv is high risk as this is part of the product for the hackathon

friedger avatar Oct 13 '23 18:10 friedger

~~I must merge the latest main changes, but the workflow remains valid.~~ done.

CAGS295 avatar Oct 25 '23 21:10 CAGS295

blocked by #350 and #307

CAGS295 avatar Nov 03 '23 05:11 CAGS295

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 16 '23 06:11 CLAassistant