(t *testing.T)
| 1327 | } |
| 1328 | |
| 1329 | func TestUserActivityInsights_Golden(t *testing.T) { |
| 1330 | t.Parallel() |
| 1331 | |
| 1332 | // Prepare test data types. |
| 1333 | type templateApp struct { |
| 1334 | name string |
| 1335 | icon string |
| 1336 | } |
| 1337 | type testTemplate struct { |
| 1338 | name string |
| 1339 | apps []templateApp |
| 1340 | |
| 1341 | // Filled later. |
| 1342 | id uuid.UUID |
| 1343 | } |
| 1344 | type workspaceApp templateApp |
| 1345 | type testWorkspace struct { |
| 1346 | name string |
| 1347 | template *testTemplate |
| 1348 | |
| 1349 | // Filled later. |
| 1350 | id uuid.UUID |
| 1351 | user any // *testUser, but it's not available yet, defined below. |
| 1352 | agentID uuid.UUID |
| 1353 | apps []*workspaceApp |
| 1354 | agentClient *agentsdk.Client |
| 1355 | } |
| 1356 | type testUser struct { |
| 1357 | name string |
| 1358 | workspaces []*testWorkspace |
| 1359 | |
| 1360 | client *codersdk.Client |
| 1361 | sdk codersdk.User |
| 1362 | |
| 1363 | // Filled later. |
| 1364 | id uuid.UUID |
| 1365 | } |
| 1366 | |
| 1367 | // Represent agent stats, to be inserted via stats batcher. |
| 1368 | type agentStat struct { |
| 1369 | // Set a range via start/end, multiple stats will be generated |
| 1370 | // within the range. |
| 1371 | startedAt time.Time |
| 1372 | endedAt time.Time |
| 1373 | |
| 1374 | sessionCountVSCode int64 |
| 1375 | sessionCountJetBrains int64 |
| 1376 | sessionCountReconnectingPTY int64 |
| 1377 | sessionCountSSH int64 |
| 1378 | noConnections bool |
| 1379 | } |
| 1380 | // Represent app usage stats, to be inserted via stats reporter. |
| 1381 | type appUsage struct { |
| 1382 | app *workspaceApp |
| 1383 | startedAt time.Time |
| 1384 | endedAt time.Time |
| 1385 | requests int |
| 1386 | } |
nothing calls this directly
no test coverage detected