Skip to content

Add documentations for tests in json#557

Merged
GalRogozinski merged 23 commits intomainfrom
test_docs
Jul 23, 2025
Merged

Add documentations for tests in json#557
GalRogozinski merged 23 commits intomainfrom
test_docs

Conversation

@alan-ssvlabs
Copy link
Contributor

closes #547

GalRogozinski
GalRogozinski previously approved these changes Jul 1, 2025
Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

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

LGTM

@Tom-ssvlabs Tom-ssvlabs requested review from MatusKysel and removed request for Tom-ssvlabs July 2, 2025 13:51
@MatusKysel MatusKysel requested a review from Copilot July 2, 2025 13:55
MatusKysel
MatusKysel previously approved these changes Jul 2, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors existing Go spec tests to use the new NewControllerSpecTest (and NewMsgProcessingSpecTest) constructors, adds descriptive documentation strings to each test, and enriches the generated JSON spec files with "Type" and "Documentation" fields.

  • Refactor: replace literal &tests.ControllerSpecTest{…} and &tests.MsgProcessingSpecTest{…} with the new constructor calls
  • Documentation: introduce a concise description string for each Go test
  • Metadata: add "Type" and "Documentation" metadata to JSON spec test files

Reviewed Changes

Copilot reviewed 300 out of 1121 changed files in this pull request and generated 1 comment.

File Description
qbft/spectest/tests/controller/latemsg/*.go Switched to tests.NewControllerSpecTest(...) and added test descriptions
qbft/spectest/tests/commit/*.go Switched to tests.NewMsgProcessingSpecTest(...) and added test descriptions
qbft/spectest/generate/tests/*.json Added "Type" and "Documentation" fields to JSON test metadata
Comments suppressed due to low confidence (1)

qbft/spectest/generate/tests/tests.RoundRobinSpecTest_qbft_round_robin_7_member_committee.json:3

  • [nitpick] Consider capitalizing 'Round Robin' in the Type field for consistency with other JSON metadata entries.
  "Type": "Round robin proposer: validation of fair proposer selection algorithm",

Copy link
Contributor

@MatheusFranco99 MatheusFranco99 left a comment

Choose a reason for hiding this comment

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

Minor questions

Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

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

You currently did the changes in unmaintainable manner.
If people creating parsers will complain that they prefer all types in snail case for example it will be hard to change...

More importantly go over this review please:
https://chatgpt.com/share/e/686f7fef-4c50-800a-b4ba-07d7e6e0bee8

@GalRogozinski
Copy link
Contributor

you are still missing docs to 5 tests (see chatGPT chat)

MatusKysel
MatusKysel previously approved these changes Jul 14, 2025
@Zacholme7
Copy link
Contributor

Re: test names & docs for state comparison - I think what is here is great and its pretty easy to just map from the input -> state comparison to make the connection manually so its not needed for that. Thx

Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

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

Per my latest comment there may be more issues like this.
We need to:

  1. Go over the test files and see if there are similar errors
  2. Use field name tags so we don't do such mistakes (also makes it easy to pick up in review)
  3. Have a dedicated string const files for types and descriptions

@Zacholme7
Copy link
Contributor

Have a dedicated string const files for types and descriptions

If possible, this would also be nice for the expected errors as I have to map from our error enums into an expected string representation

@GalRogozinski
Copy link
Contributor

@Zacholme7
we have #514 opened a long time ago. We can prioritize it.

@alan-ssvlabs alan-ssvlabs dismissed stale reviews from MatusKysel and MatheusFranco99 via 597bcea July 22, 2025 12:23
Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

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

Just small detail and that's it

Copy link
Contributor

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@Zacholme7 Zacholme7 left a comment

Choose a reason for hiding this comment

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

Nice, appreciate it

@GalRogozinski GalRogozinski merged commit 64454f2 into main Jul 23, 2025
2 checks passed
@GalRogozinski GalRogozinski deleted the test_docs branch July 23, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Documentation Comments to each Test Json

7 participants