Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite518ad5

Browse files
committed
test(coderd): fix todo for increased accuracy in insights test
1 parent7e90441 commite518ad5

4 files changed

+15
-21
lines changed

‎coderd/insights_test.go

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -956,15 +956,12 @@ func TestTemplateInsights_Golden(t *testing.T) {
956956
},
957957
},
958958
appUsage: []appUsage{
959-
// TODO(mafredri): This doesn't behave correctly right now
960-
// and will add more usage to the app. This could be
961-
// considered both correct and incorrect behavior.
962-
// { // One hour of usage, but same user and same template app, only count once.
963-
// app: users[0].workspaces[1].apps[0],
964-
// startedAt: frozenWeekAgo,
965-
// endedAt: frozenWeekAgo.Add(time.Hour),
966-
// requests: 1,
967-
// },
959+
{// One hour of usage, but same user and same template app, only count once.
960+
app:users[0].workspaces[1].apps[0],
961+
startedAt:frozenWeekAgo,
962+
endedAt:frozenWeekAgo.Add(time.Hour),
963+
requests:1,
964+
},
968965
{
969966
// Different templates but identical apps, apps will be
970967
// combined and usage will be summed.
@@ -1811,15 +1808,12 @@ func TestUserActivityInsights_Golden(t *testing.T) {
18111808
},
18121809
},
18131810
appUsage: []appUsage{
1814-
// TODO(mafredri): This doesn't behave correctly right now
1815-
// and will add more usage to the app. This could be
1816-
// considered both correct and incorrect behavior.
1817-
// { // One hour of usage, but same user and same template app, only count once.
1818-
// app: users[0].workspaces[1].apps[0],
1819-
// startedAt: frozenWeekAgo,
1820-
// endedAt: frozenWeekAgo.Add(time.Hour),
1821-
// requests: 1,
1822-
// },
1811+
{// One hour of usage, but same user and same template app, only count once.
1812+
app:users[0].workspaces[1].apps[0],
1813+
startedAt:frozenWeekAgo,
1814+
endedAt:frozenWeekAgo.Add(time.Hour),
1815+
requests:1,
1816+
},
18231817
{
18241818
// Different templates but identical apps, apps will be
18251819
// combined and usage will be summed.

‎coderd/testdata/insights/template/multiple_users_and_workspaces_three_weeks_second_template.json.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"display_name": "app1",
5454
"slug": "app1",
5555
"icon": "/icon1.png",
56-
"seconds":21600
56+
"seconds":25200
5757
}
5858
],
5959
"parameters_usage": []

‎coderd/testdata/insights/template/multiple_users_and_workspaces_three_weeks_second_template_only_report.json.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"display_name": "app1",
5454
"slug": "app1",
5555
"icon": "/icon1.png",
56-
"seconds":21600
56+
"seconds":25200
5757
}
5858
],
5959
"parameters_usage": []

‎coderd/testdata/insights/template/multiple_users_and_workspaces_week_second_template.json.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"display_name": "app1",
5252
"slug": "app1",
5353
"icon": "/icon1.png",
54-
"seconds":21600
54+
"seconds":25200
5555
}
5656
],
5757
"parameters_usage": []

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp