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

Add the NewEmulatorBackend method on TestFramework interface #2744

Merged
merged 3 commits into from
Aug 29, 2023

Conversation

m-Peter
Copy link
Contributor

@m-Peter m-Peter commented Aug 25, 2023

Closes onflow/cadence-tools#139

Description

This method is used to create a new emulator backend, each time a developer calls Test.newEmulatorBlockchain().
Up to this point, one and the same emulator backend was used, which meant that there was no way to reset state.


  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

Merging #2744 (6862627) into master (1bbc078) will not change coverage.
The diff coverage is 66.66%.

@@           Coverage Diff           @@
##           master    #2744   +/-   ##
=======================================
  Coverage   79.18%   79.18%           
=======================================
  Files         333      333           
  Lines       78536    78536           
=======================================
  Hits        62192    62192           
  Misses      14043    14043           
  Partials     2301     2301           
Flag Coverage Δ
unittests 79.18% <66.66%> (ø)

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

Files Changed Coverage Δ
runtime/stdlib/test_emulatorbackend.go 54.94% <65.71%> (ø)
runtime/stdlib/test_contract.go 87.96% <100.00%> (ø)

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Just one small suggestion

runtime/stdlib/test_test.go Outdated Show resolved Hide resolved
@m-Peter m-Peter force-pushed the testing-framework-new-emulator-backend branch from aad6fee to 8b9f42b Compare August 29, 2023 08:20
This method is used to create a new emulator backend, each time
a developer calls Test.newEmulatorBlockchain().
Up to this point, one and the same emulator backend was used,
which meant that there was no way to reset state.
@m-Peter m-Peter force-pushed the testing-framework-new-emulator-backend branch from 8b9f42b to 6862627 Compare August 29, 2023 08:22
@m-Peter m-Peter requested a review from SupunS August 29, 2023 10:03
Copy link
Member

@SupunS SupunS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@SupunS SupunS added the Go API Breaking Change Breaks programs which use the Cadence repo as a Go dependency label Aug 29, 2023
@SupunS SupunS merged commit 4e587ce into onflow:master Aug 29, 2023
10 of 14 checks passed
@m-Peter m-Peter deleted the testing-framework-new-emulator-backend branch September 6, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Go API Breaking Change Breaks programs which use the Cadence repo as a Go dependency Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Test] Test.Blockchain struct reuses one single backend implementation
3 participants