Skip to content

Initial whole-stack tests for the API Server #1259

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

Merged
merged 21 commits into from
Oct 12, 2023

Conversation

alfiedotwtf
Copy link
Contributor

Part of #1189

@TheQuantumPhysicist
Copy link
Contributor

This generally looks OK, besides the comments I made. It's still in draft, so I'm not sure what's left.

Copy link
Contributor

@iljakuklic iljakuklic left a comment

Choose a reason for hiding this comment

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

Just a quick first pass

@alfiedotwtf
Copy link
Contributor Author

alfiedotwtf commented Oct 6, 2023

It's still in draft, so I'm not sure what's left.

If you look at web-server/src/api/v1.rs, you'll see all the current endpoints. Currently only the chain/ and block/ have been done (with a hand full of TODOs within them), but there's transaction/, destination/ and pool/ that I'll work on today (and think about how to actually do destination/ given that the current values are placeholders rather than going to the database.

@iljakuklic
Copy link
Contributor

It's still in draft, so I'm not sure what's left.

If you look at web-server/src/api/v1.rs, you'll see all the current endpoints. Currently only the chain/ and block/ have been done (with a hand full of TODOs within them), but there's transaction/, destination/ and pool/ that I'll work on today (and think about how to actually do destination/ given that the current values are placeholders rather than going to the database.

Given the tests file is already over 1000 lines, would it make sense to break it down by endpoint tested? I guess the categorisation is not going to be 100% accurate since I can imagine tests that check a combination of endpoints but maybe better than a monolithic file.

@alfiedotwtf alfiedotwtf force-pushed the alfie/webserver-tests branch from e662369 to 3fd89cb Compare October 10, 2023 07:42
@alfiedotwtf
Copy link
Contributor Author

Given the tests file is already over 1000 lines, would it make sense to break it down by endpoint tested? I guess the categorisation is not going to be 100% accurate since I can imagine tests that check a combination of endpoints but maybe better than a monolithic file.

I use code folding in Emac a lot, and because I've put each set of tests within a separately named module within the file, when the test file is collapsed, it logically makes sense. Not as clear as spreading this out to multiple files though, but code folding does let you see the shape of the file and lets you drill down when needed.

@alfiedotwtf
Copy link
Contributor Author

I've added a few transaction() and transaction_merkle_path() tests, but there a many TODOs left in the comments.

This PR is getting quite big as it is, so maybe the TODOs can be done in a separate PR along with the Destination and Pool endpoint changes / tests.

@alfiedotwtf alfiedotwtf marked this pull request as ready for review October 10, 2023 11:58
Copy link
Contributor

@TheQuantumPhysicist TheQuantumPhysicist left a comment

Choose a reason for hiding this comment

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

Besides the TODOs, this is looking fine. I'm assuming these TODOs will be fixed next.

alfiedotwtf and others added 11 commits October 12, 2023 16:44

Verified

This commit was signed with the committer’s verified signature.

Verified

This commit was signed with the committer’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
alfiedotwtf and others added 10 commits October 12, 2023 16:44

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@alfiedotwtf alfiedotwtf force-pushed the alfie/webserver-tests branch from 57b4967 to 9a5ef7a Compare October 12, 2023 05:48
@TheQuantumPhysicist TheQuantumPhysicist merged commit ccc4103 into master Oct 12, 2023
@TheQuantumPhysicist TheQuantumPhysicist deleted the alfie/webserver-tests branch October 12, 2023 12:45
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

3 participants