time: add time tests and add std symbol coverage checks#1466
time: add time tests and add std symbol coverage checks#1466xushiwei merged 2 commits intogoplus:mainfrom
Conversation
Summary of ChangesHello @cpunion, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly updates the Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Code Review SummaryThis PR adds a well-structured stdlib symbol coverage checker and syncs the time runtime implementation. The code demonstrates good engineering practices overall. Below are the key findings from comprehensive review: Highlights:
Key Issues to Address:
See inline comments for specific recommendations. |
There was a problem hiding this comment.
Code Review
This pull request synchronizes the time package implementation and its test suite with the standard library, which includes several bug fixes and new features like support for periodic timers and additional time formatting/parsing capabilities. It also introduces a new tool, check_std_symbols, to verify test coverage of exported symbols in standard library packages.
My main feedback is regarding the implementation of the new coverage checker tool. It currently parses the output of go doc to find exported symbols, which is a fragile approach. I've suggested a more robust implementation using the go/packages library.
The rest of the changes, primarily syncing the time package, look solid and bring important improvements.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1466 +/- ##
=======================================
Coverage 90.58% 90.58%
=======================================
Files 43 43
Lines 11429 11429
=======================================
Hits 10353 10353
Misses 914 914
Partials 162 162 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR contains two commits:
1)
time: add time tests and fix timer semanticstest/std/timesuite.runtime/internal/lib/timeso timers/tickers match Go semantics (e.g.Timer.Resetreturn value behavior).runtime.AssertDivideByZeroneeded by the updated code.2)
chore: add check_std_symbols std coverage checkschore/check_std_symbols(with tests) to enforce std exported-symbol coverage.doc/_readme/scripts/check_std_cover.sh..github/workflows/stdlib-coverage.yml.github/workflows/go.ymlTesting strategy
The
test/std/timesuite is exercised in two ways:go test ./test/std/timevalidates the test harness and expected behavior against the Go toolchain../llgo.sh test ./test/std/timevalidates LLGo’s runtime/stdlib implementation matches those expectations.Verification
go test ./test/std/time./llgo.sh test ./test/std/timego test ./chore/check_std_symbolsbash doc/_readme/scripts/check_std_cover.sh