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

Commit5aa0ffa

Browse files
test(coderd/database): improve test coverage
1 parentacb93ac commit5aa0ffa

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

‎coderd/database/querier_test.go

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,6 +2186,7 @@ func TestGetProvisionerJobsByIDsWithQueuePosition(t *testing.T) {
21862186
// but this should not affect the queue position or queue size of other jobs.
21872187
skipJobIDsmap[int]struct{}
21882188
}{
2189+
// Baseline test case
21892190
{
21902191
name:"test-case-1",
21912192
jobTags: []database.StringMap{
@@ -2200,7 +2201,7 @@ func TestGetProvisionerJobsByIDsWithQueuePosition(t *testing.T) {
22002201
queueSizes: []int64{2,2,0},
22012202
queuePositions: []int64{1,1,0},
22022203
},
2203-
//Similar to the previous case, but includesan additional provisioner.
2204+
//Includesan additional provisioner
22042205
{
22052206
name:"test-case-2",
22062207
jobTags: []database.StringMap{
@@ -2216,7 +2217,7 @@ func TestGetProvisionerJobsByIDsWithQueuePosition(t *testing.T) {
22162217
queueSizes: []int64{3,3,3},
22172218
queuePositions: []int64{1,1,3},
22182219
},
2219-
//Similar to the previous case, but skips job at index 0
2220+
//Skips job at index 0
22202221
{
22212222
name:"test-case-3",
22222223
jobTags: []database.StringMap{
@@ -2293,6 +2294,46 @@ func TestGetProvisionerJobsByIDsWithQueuePosition(t *testing.T) {
22932294
2: {},
22942295
},
22952296
},
2297+
// Includes two additional jobs that any provisioner can execute.
2298+
{
2299+
name:"test-case-7",
2300+
jobTags: []database.StringMap{
2301+
{},
2302+
{},
2303+
{"a":"1","b":"2"},
2304+
{"a":"1"},
2305+
{"a":"1","c":"3"},
2306+
},
2307+
daemonTags: []database.StringMap{
2308+
{"a":"1","b":"2"},
2309+
{"a":"1"},
2310+
{"a":"1","b":"2","c":"3"},
2311+
},
2312+
queueSizes: []int64{5,5,5,5,5},
2313+
queuePositions: []int64{1,2,3,3,5},
2314+
},
2315+
// Includes two additional jobs that any provisioner can execute, but they are intentionally skipped.
2316+
{
2317+
name:"test-case-8",
2318+
jobTags: []database.StringMap{
2319+
{},
2320+
{},
2321+
{"a":"1","b":"2"},
2322+
{"a":"1"},
2323+
{"a":"1","c":"3"},
2324+
},
2325+
daemonTags: []database.StringMap{
2326+
{"a":"1","b":"2"},
2327+
{"a":"1"},
2328+
{"a":"1","b":"2","c":"3"},
2329+
},
2330+
queueSizes: []int64{5,5,5},
2331+
queuePositions: []int64{3,3,5},
2332+
skipJobIDs:map[int]struct{}{
2333+
0: {},
2334+
1: {},
2335+
},
2336+
},
22962337
}
22972338

22982339
for_,tc:=rangetestCases {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp