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

OSS Support Grant: Milestone 2 - Add methods to inspect account storage #215

Merged
merged 13 commits into from
Apr 28, 2023

Conversation

MaxStalker
Copy link
Collaborator

Work in progress for #205

Description

This PR adds multiple new methods to query storage:

  • getPaths - returning an object containing paths for public, private and storage domains
  • getPathsWithType - same as above, but with more detailed info about Capabilities
  • getStorageValue - returning value at specified storage path
  • getStorageStats - used and storage capacity info

Jest helpers added:

  • shallHavePath - checks that account have path on specified domain
  • shallHaveStorageValue - checks that account have specific value stored

Documentation

Updated documentation:

  • API reference for newly added functions
  • Jest Asserts documentation

Tests

All new methods are covered with tests.

Changeset:

Changeset for new minor version is included

For contributor use:

  • 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

@MaxStalker MaxStalker added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 7, 2023
@MaxStalker MaxStalker requested a review from a team as a code owner April 7, 2023 21:44
@MaxStalker MaxStalker self-assigned this Apr 7, 2023
@changeset-bot
Copy link

changeset-bot bot commented Apr 7, 2023

🦋 Changeset detected

Latest commit: bfa97fd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@onflow/flow-js-testing Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2023

Dependency Testbed

  • Flow CLI: 1.0.2
  • FCL: ^1.3.2

Release Version

The package containing these changes will be released with version 0.4.0

@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2023

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
92.6% (+0.6% 🔼)
626/676
🟡 Branches
76.83% (+0.89% 🔼)
189/246
🟢 Functions
93.33% (+1.16% 🔼)
126/135
🟢 Lines
93.04% (+0.56% 🔼)
602/647
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢 storage.js 90.91% 66.67% 93.33% 90.91%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢 utils.js
88.57% (-5.87% 🔻)
78.26% (+0.48% 🔼)
100%
90% (-10% 🔻)

Test suite run success

111 tests passing in 15 suites.

Report generated by 🧪jest coverage report action from bfa97fd

chasefleming
chasefleming previously approved these changes Apr 26, 2023
@chasefleming
Copy link
Member

Screenshot 2023-04-26 at 3 22 51 PM

@MaxStalker I'm running the tests locally (with emulator running and npm run test) and some are failing for me. Is there a step I'm missing? If so, can we add it to the readme? And can we hook it up to the CI?

@MaxStalker
Copy link
Collaborator Author

MaxStalker commented Apr 27, 2023

@chasefleming you don't need to run emulator manually - running tests with npm run test is enough as framework handles emulator process internally.

And we have GitHub actions setup, which will run tests and report back on a PR - you can see comments from it slightly above.

The error is probably related to new version of Flow CLI, similar to what was reported here:
#216

I will investigate what is happening 👀

@MaxStalker
Copy link
Collaborator Author

@chasefleming I've added small change so it would properly catch logs on latest Flow CLI.
Can you take another look? :)

Copy link
Member

@chasefleming chasefleming left a comment

Choose a reason for hiding this comment

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

Tests pass now, thanks!

@MaxStalker MaxStalker merged commit 7c302b8 into master Apr 28, 2023
@MaxStalker MaxStalker deleted the max/storage-inspect branch April 28, 2023 04:05
@github-actions github-actions bot mentioned this pull request Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants