-
Notifications
You must be signed in to change notification settings - Fork 51
Clear and fix metrics computation #484
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
Changes from 11 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a57f776
fix metrics
hiyuchang 6697293
add eval_metrics
hiyuchang a2fc766
fix typo
hiyuchang 19dc713
fix unittest
hiyuchang 280bda1
fix comment
hiyuchang cf68900
fix pre-commit
hiyuchang b5bcc0f
fix eval metrics
hiyuchang 1d557c0
Merge branch 'main' into dev/fix_metric
hiyuchang de7f834
update unittest with submodule function
hiyuchang 85e2b14
fix unittest
hiyuchang 7037ce6
remove submodule unittest
hiyuchang 02dbe30
add detailed_stats
hiyuchang fcde019
missing revision
hiyuchang ead5523
add english doc
hiyuchang 76b53a6
update docs
hiyuchang 537470c
polish doc
hiyuchang 397caaa
improve doc
hiyuchang c3326b3
improve chinese doc
hiyuchang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import datetime | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
| # Get the result of each test | ||
| @pytest.hookimpl(tryfirst=True, hookwrapper=True) | ||
| def pytest_runtest_makereport(item, call): | ||
| outcome = yield | ||
| rep = outcome.get_result() | ||
| setattr(item, "rep_" + rep.when, rep) | ||
|
|
||
|
|
||
| # Real-time print of start and end of test | ||
| @pytest.fixture(autouse=True) | ||
| def log_test_lifecycle(request): | ||
| node_id = request.node.nodeid | ||
| start_time = datetime.datetime.now().strftime("%H:%M:%S") | ||
|
|
||
| print(f"\n[START] {start_time} - Running: {node_id}") | ||
|
|
||
| yield | ||
|
|
||
| end_time = datetime.datetime.now().strftime("%H:%M:%S") | ||
| # Get the result of each test (setup, call, teardown) | ||
| report = getattr(request.node, "rep_call", None) | ||
|
|
||
| if report: | ||
| if report.passed: | ||
| status = "PASSED" | ||
| elif report.failed: | ||
| status = "FAILED" | ||
| else: | ||
| status = report.outcome.upper() | ||
| else: | ||
| status = "UNKNOWN" | ||
|
|
||
| print(f"\n[END] {end_time} - Result: {status} - {node_id}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.