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

Commit3cd22e7

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

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
@@ -957,15 +957,12 @@ func TestTemplateInsights_Golden(t *testing.T) {
957957
},
958958
},
959959
appUsage: []appUsage{
960-
// TODO(mafredri): This doesn't behave correctly right now
961-
// and will add more usage to the app. This could be
962-
// considered both correct and incorrect behavior.
963-
// { // One hour of usage, but same user and same template app, only count once.
964-
// app: users[0].workspaces[1].apps[0],
965-
// startedAt: frozenWeekAgo,
966-
// endedAt: frozenWeekAgo.Add(time.Hour),
967-
// requests: 1,
968-
// },
960+
{// One hour of usage, but same user and same template app, only count once.
961+
app:users[0].workspaces[1].apps[0],
962+
startedAt:frozenWeekAgo,
963+
endedAt:frozenWeekAgo.Add(time.Hour),
964+
requests:1,
965+
},
969966
{
970967
// Different templates but identical apps, apps will be
971968
// combined and usage will be summed.
@@ -1812,15 +1809,12 @@ func TestUserActivityInsights_Golden(t *testing.T) {
18121809
},
18131810
},
18141811
appUsage: []appUsage{
1815-
// TODO(mafredri): This doesn't behave correctly right now
1816-
// and will add more usage to the app. This could be
1817-
// considered both correct and incorrect behavior.
1818-
// { // One hour of usage, but same user and same template app, only count once.
1819-
// app: users[0].workspaces[1].apps[0],
1820-
// startedAt: frozenWeekAgo,
1821-
// endedAt: frozenWeekAgo.Add(time.Hour),
1822-
// requests: 1,
1823-
// },
1812+
{// One hour of usage, but same user and same template app, only count once.
1813+
app:users[0].workspaces[1].apps[0],
1814+
startedAt:frozenWeekAgo,
1815+
endedAt:frozenWeekAgo.Add(time.Hour),
1816+
requests:1,
1817+
},
18241818
{
18251819
// Different templates but identical apps, apps will be
18261820
// 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
@@ -61,7 +61,7 @@
6161
"display_name": "app1",
6262
"slug": "app1",
6363
"icon": "/icon1.png",
64-
"seconds":21600
64+
"seconds":25200
6565
}
6666
],
6767
"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
@@ -61,7 +61,7 @@
6161
"display_name": "app1",
6262
"slug": "app1",
6363
"icon": "/icon1.png",
64-
"seconds":21600
64+
"seconds":25200
6565
}
6666
],
6767
"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
@@ -59,7 +59,7 @@
5959
"display_name": "app1",
6060
"slug": "app1",
6161
"icon": "/icon1.png",
62-
"seconds":21600
62+
"seconds":25200
6363
}
6464
],
6565
"parameters_usage": []

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp