Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
2c06255f
Commit
2c06255f
authored
Jan 04, 2026
by
IanShaw027
Browse files
fix(test): 修复集成测试中 err 变量重复声明问题
parent
7e6a197d
Changes
1
Show whitespace changes
Inline
Side-by-side
backend/internal/repository/usage_log_repo_integration_test.go
View file @
2c06255f
...
...
@@ -73,7 +73,7 @@ func (s *UsageLogRepoSuite) TestCreate() {
ActualCost
:
0.4
,
}
_
,
err
=
s
.
repo
.
Create
(
s
.
ctx
,
log
)
_
,
err
:
=
s
.
repo
.
Create
(
s
.
ctx
,
log
)
s
.
Require
()
.
NoError
(
err
,
"Create"
)
s
.
Require
()
.
NotZero
(
log
.
ID
)
}
...
...
@@ -240,7 +240,7 @@ func (s *UsageLogRepoSuite) TestDashboardStats_TodayTotalsAndPerformance() {
DurationMs
:
&
d1
,
CreatedAt
:
maxTime
(
todayStart
.
Add
(
2
*
time
.
Minute
),
now
.
Add
(
-
2
*
time
.
Minute
)),
}
_
,
err
=
s
.
repo
.
Create
(
s
.
ctx
,
logToday
)
_
,
err
:
=
s
.
repo
.
Create
(
s
.
ctx
,
logToday
)
s
.
Require
()
.
NoError
(
err
,
"Create logToday"
)
logOld
:=
&
service
.
UsageLog
{
...
...
@@ -483,7 +483,7 @@ func (s *UsageLogRepoSuite) TestListByModelAndTimeRange() {
ActualCost
:
0.5
,
CreatedAt
:
base
,
}
_
,
err
=
s
.
repo
.
Create
(
s
.
ctx
,
log1
)
_
,
err
:
=
s
.
repo
.
Create
(
s
.
ctx
,
log1
)
s
.
Require
()
.
NoError
(
err
)
log2
:=
&
service
.
UsageLog
{
...
...
@@ -598,7 +598,7 @@ func (s *UsageLogRepoSuite) TestGetUserModelStats() {
ActualCost
:
0.5
,
CreatedAt
:
base
,
}
_
,
err
=
s
.
repo
.
Create
(
s
.
ctx
,
log1
)
_
,
err
:
=
s
.
repo
.
Create
(
s
.
ctx
,
log1
)
s
.
Require
()
.
NoError
(
err
)
log2
:=
&
service
.
UsageLog
{
...
...
@@ -693,7 +693,7 @@ func (s *UsageLogRepoSuite) TestGetModelStatsWithFilters() {
ActualCost
:
0.5
,
CreatedAt
:
base
,
}
_
,
err
=
s
.
repo
.
Create
(
s
.
ctx
,
log1
)
_
,
err
:
=
s
.
repo
.
Create
(
s
.
ctx
,
log1
)
s
.
Require
()
.
NoError
(
err
)
log2
:=
&
service
.
UsageLog
{
...
...
@@ -750,7 +750,7 @@ func (s *UsageLogRepoSuite) TestGetAccountUsageStats() {
ActualCost
:
0.4
,
CreatedAt
:
base
.
Add
(
12
*
time
.
Hour
),
}
_
,
err
=
s
.
repo
.
Create
(
s
.
ctx
,
log1
)
_
,
err
:
=
s
.
repo
.
Create
(
s
.
ctx
,
log1
)
s
.
Require
()
.
NoError
(
err
)
log2
:=
&
service
.
UsageLog
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment