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

End-to-end publishEntry tests #167

Merged
merged 19 commits into from
Jun 23, 2022
Merged

Conversation

sandreae
Copy link
Member

@sandreae sandreae commented Jun 17, 2022

End-to-end tests (including many failing cases) for publishing entries.

This PR throws up a few TODOs as I find some panicking cases. I suggest not fixing them in this PR but instead raising issues.

Probably worth waiting for this: p2panda/p2panda#367 then we can introduce tests for these new errors and more invalid encoded entries as well.

Targeting p2panda-rs branch which fixes EntrySigned validation: https://github.com/p2panda/p2panda/tree/improve-validation-in-entry-signed

Follow-up issues: #160 #159

  • BEFORE MERGE: merge this in p2panda-rs and then switch target branch back to main

📋 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 Jun 17, 2022

Codecov Report

Merging #167 (e9450c0) into development (a4acac6) will increase coverage by 0.63%.
The diff coverage is 100.00%.

❗ Current head e9450c0 differs from pull request most recent head 9292400. Consider uploading reports for the commit 9292400 to get more accurate results

@@               Coverage Diff               @@
##           development     #167      +/-   ##
===============================================
+ Coverage        89.34%   89.97%   +0.63%     
===============================================
  Files               43       43              
  Lines             2486     2633     +147     
===============================================
+ Hits              2221     2369     +148     
+ Misses             265      264       -1     
Impacted Files Coverage Δ
aquadoggo/src/db/provider.rs 87.50% <ø> (ø)
aquadoggo/src/db/stores/test_utils.rs 98.97% <ø> (ø)
aquadoggo/src/db/utils.rs 99.52% <ø> (ø)
aquadoggo/src/db/stores/schema.rs 96.62% <100.00%> (ø)
aquadoggo/src/graphql/client/mutation.rs 98.04% <100.00%> (+4.94%) ⬆️
aquadoggo/src/materializer/worker.rs 90.04% <0.00%> (-0.42%) ⬇️
aquadoggo/src/db/stores/entry.rs 95.89% <0.00%> (+1.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4acac6...9292400. Read the comment docs.

@sandreae sandreae linked an issue Jun 17, 2022 that may be closed by this pull request
@sandreae sandreae marked this pull request as ready for review June 17, 2022 23:25
@sandreae sandreae marked this pull request as draft June 18, 2022 15:42
Comment on lines +348 to +360
#[case::should_not_include_skiplink(
&entry_signed_encoded_unvalidated(
14,
1,
Some(DEFAULT_HASH.parse().unwrap()),
Some(DEFAULT_HASH.parse().unwrap()),
Some(Operation::from(&OperationEncoded::new(OPERATION_ENCODED).unwrap()))
,
key_pair(DEFAULT_PRIVATE_KEY)
),
OPERATION_ENCODED,
"Could not decode payload hash DecodeError"
)]
Copy link
Member

Choose a reason for hiding this comment

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

Note: Example for error handling discussion

@sandreae sandreae marked this pull request as ready for review June 20, 2022 16:05
Copy link
Member

@adzialocha adzialocha left a comment

Choose a reason for hiding this comment

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

Thank you for finally taking care of this. Looks ready to go to me!


let response = response.json::<serde_json::Value>().await;

// TODO: I think we'd like a nicer error message here.
Copy link
Member

Choose a reason for hiding this comment

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

I'd link to this issue here: #159

@sandreae sandreae merged commit 5a1a845 into development Jun 23, 2022
adzialocha added a commit that referenced this pull request Jun 23, 2022
* development:
  End-to-end publishEntry tests (#167)
adzialocha added a commit that referenced this pull request Jun 27, 2022
* main:
  Update README.md
  UPSERT documents (#173)
  Run tests against PostgreSQL, fix compatibility (#170)
  End-to-end publishEntry tests (#167)
  Reschedule pending tasks during startup (#168)
adzialocha added a commit that referenced this pull request Jun 27, 2022
* main:
  Update README.md
  UPSERT documents (#173)
  Run tests against PostgreSQL, fix compatibility (#170)
  End-to-end publishEntry tests (#167)
adzialocha added a commit that referenced this pull request Jun 27, 2022
* main:
  Update README.md
  UPSERT documents (#173)
  Run tests against PostgreSQL, fix compatibility (#170)
  End-to-end publishEntry tests (#167)
@adzialocha adzialocha deleted the end-to-end-publish-tests branch June 29, 2022 14:00
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.

Bring back end-to-end publish entry tests
3 participants