mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 09:00:20 +08:00
feat: use dependabot for goctl (#2869)
* feat: use dependabot for goctl * chore: add more tests * chore: remove temp file
This commit is contained in:
parent
ea7dab3d26
commit
99a7e6600d
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@ -9,3 +9,7 @@ updates:
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod" # See documentation for possible values
|
||||
directory: "/tools/goctl" # Location of package manifests
|
||||
schedule:
|
||||
interval: "daily"
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -11,7 +11,7 @@
|
||||
!api
|
||||
|
||||
# ignore
|
||||
.idea
|
||||
**/.idea
|
||||
**/.DS_Store
|
||||
**/logs
|
||||
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/zeromicro/go-zero/core/fs"
|
||||
"github.com/zeromicro/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
func TestDailyRotateRuleMarkRotated(t *testing.T) {
|
||||
@ -232,6 +233,23 @@ func TestRotateLoggerWithSizeLimitRotateRuleMayCompressFileTrue(t *testing.T) {
|
||||
assert.NotNil(t, err)
|
||||
}
|
||||
|
||||
func TestRotateLoggerWithSizeLimitRotateRuleMayCompressFileFailed(t *testing.T) {
|
||||
old := os.Stdout
|
||||
os.Stdout = os.NewFile(0, os.DevNull)
|
||||
defer func() {
|
||||
os.Stdout = old
|
||||
}()
|
||||
|
||||
filename := stringx.RandId()
|
||||
logger, err := NewLogger(filename, new(SizeLimitRotateRule), true)
|
||||
defer os.Remove(filename)
|
||||
if assert.NoError(t, err) {
|
||||
assert.NotPanics(t, func() {
|
||||
logger.maybeCompressFile(stringx.RandId())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestRotateLoggerWithSizeLimitRotateRuleRotate(t *testing.T) {
|
||||
filename, err := fs.TempFilenameWithText("foo")
|
||||
assert.Nil(t, err)
|
||||
|
Loading…
Reference in New Issue
Block a user