-
Notifications
You must be signed in to change notification settings - Fork 1
expose scheduler now func #5
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
Conversation
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.
Pull Request Overview
This PR exposes the scheduler’s current time function by renaming the internal nowFunc to the exported NowFunc, allowing tests to override it. Additionally, a Go workflow is added for building and testing the project.
- Renamed nowFunc to NowFunc in scheduler.go and scheduler_test.go.
- Updated all references accordingly in tests and production code.
- Introduced a new GitHub Actions workflow in .github/workflows/go.yml.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
scheduler/scheduler_test.go | Updated test references to use the exported NowFunc and adjusted test setups accordingly. |
scheduler/scheduler.go | Renamed nowFunc to NowFunc to allow external overriding, with corresponding documentation update. |
.github/workflows/go.yml | Added workflow file to automate build and test processes for the Go project. |
.github/workflows/go.yml
Outdated
- name: Test | ||
run: go test -p=1 -count=1 -failfast -coverprofile=coverage.txt -coverpkg=github.com/qor5/... ./... | ||
env: | ||
GO_TESTING: "TRUE" No newline at end of file |
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.
这里没必要
.github/workflows/go.yml
Outdated
branches: [ "main", "develop" ] | ||
|
||
permissions: | ||
id-token: write |
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.
这个权限应该是没必要
.github/workflows/go.yml
Outdated
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "main", "develop" ] |
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.
这些 branch 也没用到
9531ef6
to
79a8b29
Compare
…n in TestEnqueueLockUnlock
No description provided.