Skip to content

test(coderd): fix todo for increased accuracy in insights test #12727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions coderd/insights_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -956,15 +956,12 @@ func TestTemplateInsights_Golden(t *testing.T) {
},
},
appUsage: []appUsage{
// TODO(mafredri): This doesn't behave correctly right now
// and will add more usage to the app. This could be
// considered both correct and incorrect behavior.
// { // One hour of usage, but same user and same template app, only count once.
// app: users[0].workspaces[1].apps[0],
// startedAt: frozenWeekAgo,
// endedAt: frozenWeekAgo.Add(time.Hour),
// requests: 1,
// },
{ // One hour of usage, but same user and same template app, only count once.
app: users[0].workspaces[1].apps[0],
startedAt: frozenWeekAgo,
endedAt: frozenWeekAgo.Add(time.Hour),
requests: 1,
},
{
// Different templates but identical apps, apps will be
// combined and usage will be summed.
Expand Down Expand Up @@ -1811,15 +1808,12 @@ func TestUserActivityInsights_Golden(t *testing.T) {
},
},
appUsage: []appUsage{
// TODO(mafredri): This doesn't behave correctly right now
// and will add more usage to the app. This could be
// considered both correct and incorrect behavior.
// { // One hour of usage, but same user and same template app, only count once.
// app: users[0].workspaces[1].apps[0],
// startedAt: frozenWeekAgo,
// endedAt: frozenWeekAgo.Add(time.Hour),
// requests: 1,
// },
{ // One hour of usage, but same user and same template app, only count once.
app: users[0].workspaces[1].apps[0],
startedAt: frozenWeekAgo,
endedAt: frozenWeekAgo.Add(time.Hour),
requests: 1,
},
{
// Different templates but identical apps, apps will be
// combined and usage will be summed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"display_name": "app1",
"slug": "app1",
"icon": "/icon1.png",
"seconds": 21600
"seconds": 25200
}
],
"parameters_usage": []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"display_name": "app1",
"slug": "app1",
"icon": "/icon1.png",
"seconds": 21600
"seconds": 25200
}
],
"parameters_usage": []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"display_name": "app1",
"slug": "app1",
"icon": "/icon1.png",
"seconds": 21600
"seconds": 25200
}
],
"parameters_usage": []
Expand Down