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

Optimize test data generation methods #572

Merged
merged 6 commits into from
Sep 24, 2023

Conversation

sandreae
Copy link
Member

@sandreae sandreae commented Sep 24, 2023

The methods for generation test data which were imported from p2panda_rs used methods from the api module to publish data to a test node. These methods include validation and retrieving next args (both bring extra db queries) which aren't required when generating test data. This PR refactors the test methods populate_node and populate_and_materialize to generate test data in a more performant manner.

I took the opportunity to make one more change to the test generation api which is that a vec of key pairs is passed in manually to be used for generating the test data. Previously these were generated internally.

📋 Checklist

  • Add tests that cover your changes
  • Add this PR to the Unreleased section in CHANGELOG.md
  • Link this PR to any issues it closes
  • New files contain a SPDX license header

@codecov
Copy link

codecov bot commented Sep 24, 2023

Codecov Report

Patch coverage: 96.00% and no project coverage change.

Comparison is base (27c5069) 92.40% compared to head (7fee3dd) 92.41%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #572    +/-   ##
========================================
  Coverage   92.40%   92.41%            
========================================
  Files         106      106            
  Lines       18062    18164   +102     
========================================
+ Hits        16691    16787    +96     
- Misses       1371     1377     +6     
Files Changed Coverage Δ
aquadoggo/src/test_utils/node.rs 94.64% <91.03%> (-0.61%) ⬇️
aquadoggo/src/db/stores/blob.rs 98.18% <100.00%> (ø)
aquadoggo/src/db/stores/document.rs 98.73% <100.00%> (+0.19%) ⬆️
aquadoggo/src/db/stores/entry.rs 99.13% <100.00%> (+0.01%) ⬆️
aquadoggo/src/db/stores/operation.rs 89.63% <100.00%> (ø)
aquadoggo/src/db/stores/query.rs 96.13% <100.00%> (ø)
aquadoggo/src/db/stores/schema.rs 98.37% <100.00%> (ø)
aquadoggo/src/graphql/mutations/publish.rs 98.71% <100.00%> (+<0.01%) ⬆️
aquadoggo/src/graphql/queries/next_args.rs 96.95% <100.00%> (-0.06%) ⬇️
aquadoggo/src/materializer/service.rs 94.78% <100.00%> (ø)
... and 6 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sandreae sandreae merged commit 123fac4 into main Sep 24, 2023
10 checks passed
@adzialocha adzialocha deleted the optimize-test-data-generation-methods branch September 25, 2023 22:31
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