Skip to content

Conversation

iBakuman
Copy link

No description provided.

@molon molon requested a review from Copilot June 20, 2025 02:03
Copy link

@Copilot 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 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.

- 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
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里没必要

branches: [ "main", "develop" ]

permissions:
id-token: write
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个权限应该是没必要

on:
workflow_dispatch:
push:
branches: [ "main", "develop" ]
Copy link
Collaborator

Choose a reason for hiding this comment

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

这些 branch 也没用到

@theplant-ci theplant-ci added size/M and removed size/S labels Jun 20, 2025
@molon molon merged commit 3e2fb38 into qor5:master Jun 20, 2025
2 checks passed
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.

3 participants