-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
misc: api: Annotate lotus tests according to listed behaviors #7835
Conversation
wallet tests
message pool tests
Codecov Report
@@ Coverage Diff @@
## master #7835 +/- ##
==========================================
- Coverage 39.16% 39.16% -0.01%
==========================================
Files 660 660
Lines 71419 71419
==========================================
- Hits 27973 27968 -5
+ Misses 38628 38626 -2
- Partials 4818 4825 +7
Continue to review full report at Codecov.
|
@@ -1,3 +1,4 @@ | |||
//stm: #unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we deduce unit/integration based on directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's possible to do so (ie. tests in the itests
folder are integration tests), though I'm not sure if anything more than that is too fragile and inflexible.
I would suggest something different: the crawler can add an annotation stm: #TODO
to the top of each test file that does not already have a specified annotation. These TODO's can then be shown as warnings in the dashboard, or in the CI, etc. This way, the developer is forced to fill in the correct type.
Related Issues
filecoin-project/system-test-matrix#279
filecoin-project/system-test-matrix#226
filecoin-project/system-test-matrix#225
Proposed Changes
Annotate all tests according to behaviors specified in the system-test-behavior and system-test-matrix. Collect these annotations so that we can gain an overview of lotus test coverage.
The System Test Matrix is a dashboard with a detailed list of FIL features and behaviors and a mapping between those features
and test suites, systems and subsystems that those features are related to.
Files and tests are annotated using
//stm:
comments.Every FIL test file is marked with a special annotation at the top of the file (e.g. #unit, #integration, #cli, #api ... )
For example,
//stm: #unit
would mark the file as a unit test file.The test crawler will gather all test files, including those that are not annotated using a file-level annotation. However, test coverage will be collected only from files bearing a file-level annotation.
Single tests are annotated using
//stm: @
comments, with each behavior preceded by the@
character.For example, a test with the following comment
//stm: @MARKET_RESERVE_FUNDS_001, @MINER_CREATE_BLOCK_001
is assumed to test:
MARKET_RESERVE_FUNDS_001
behaviormarket
systemMINER_CREATE_BLOCK_001
behavior of theminer
systemThe system-test-matrix crawler will go through all lotus tests, gather information from all unit and integration tests present,
and document:
This information is then compiled into an output
json
file, and shown in the system-test-matrix dashboard. The dashboard offers visualization and querying of test and behavior coverage of the entire lotus repository.Additional Info
See https://github.com/filecoin-project/system-test-matrix for additional information on test annotations.