-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for generating the trigger queue
- Loading branch information
Showing
6 changed files
with
393 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[ | ||
# add new test cases here | ||
# each item will be used for each architecture generated | ||
# [ ".build.resloved", "count", "skips" ] | ||
[ null, 1, 0 ], # buildable, tried once | ||
[ null, 23, 0 ], # buildable, tried many but less than skip threshold | ||
[ null, 24, 0 ], # buildable, tried many, just on skip threshold | ||
[ null, 25, 23 ], # buildable, final skip | ||
[ null, 25, 24 ], # buildable, no longer skipped | ||
[ {}, 3, 0 ], # build "complete" (not queued or skipped) | ||
empty # trailing comma | ||
] | ||
| map( | ||
("amd64", "arm32v7") as $arch | ||
| ([ $arch, .[] | tostring ] | join("-")) as $buildId | ||
| { | ||
# give our inputs cuter names | ||
resolved: .[0], | ||
count: .[1], | ||
skips: .[2], | ||
} | ||
| [ | ||
{ | ||
count, | ||
skips, | ||
}, | ||
{ | ||
$buildId, | ||
build: { | ||
$arch, | ||
resolved, | ||
}, | ||
"source": { | ||
"arches": { | ||
($arch): { | ||
"tags": ["fake:\($buildId)"] | ||
}, | ||
}, | ||
}, | ||
}, | ||
empty # trailing comma | ||
] | ||
| map({ ($buildId): . }) | ||
) | ||
| transpose | ||
| map(add) | ||
| { pastjobs: .[0], builds: .[1] } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,246 @@ | ||
{ | ||
"pastjobs": { | ||
"amd64-null-1-0": { | ||
"count": 1, | ||
"skips": 0 | ||
}, | ||
"arm32v7-null-1-0": { | ||
"count": 1, | ||
"skips": 0 | ||
}, | ||
"amd64-null-23-0": { | ||
"count": 23, | ||
"skips": 0 | ||
}, | ||
"arm32v7-null-23-0": { | ||
"count": 23, | ||
"skips": 0 | ||
}, | ||
"amd64-null-24-0": { | ||
"count": 24, | ||
"skips": 0 | ||
}, | ||
"arm32v7-null-24-0": { | ||
"count": 24, | ||
"skips": 0 | ||
}, | ||
"amd64-null-25-23": { | ||
"count": 25, | ||
"skips": 23 | ||
}, | ||
"arm32v7-null-25-23": { | ||
"count": 25, | ||
"skips": 23 | ||
}, | ||
"amd64-null-25-24": { | ||
"count": 25, | ||
"skips": 24 | ||
}, | ||
"arm32v7-null-25-24": { | ||
"count": 25, | ||
"skips": 24 | ||
}, | ||
"amd64-{}-3-0": { | ||
"count": 3, | ||
"skips": 0 | ||
}, | ||
"arm32v7-{}-3-0": { | ||
"count": 3, | ||
"skips": 0 | ||
} | ||
}, | ||
"builds": { | ||
"amd64-null-1-0": { | ||
"buildId": "amd64-null-1-0", | ||
"build": { | ||
"arch": "amd64", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"amd64": { | ||
"tags": [ | ||
"fake:amd64-null-1-0" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"arm32v7-null-1-0": { | ||
"buildId": "arm32v7-null-1-0", | ||
"build": { | ||
"arch": "arm32v7", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"arm32v7": { | ||
"tags": [ | ||
"fake:arm32v7-null-1-0" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"amd64-null-23-0": { | ||
"buildId": "amd64-null-23-0", | ||
"build": { | ||
"arch": "amd64", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"amd64": { | ||
"tags": [ | ||
"fake:amd64-null-23-0" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"arm32v7-null-23-0": { | ||
"buildId": "arm32v7-null-23-0", | ||
"build": { | ||
"arch": "arm32v7", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"arm32v7": { | ||
"tags": [ | ||
"fake:arm32v7-null-23-0" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"amd64-null-24-0": { | ||
"buildId": "amd64-null-24-0", | ||
"build": { | ||
"arch": "amd64", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"amd64": { | ||
"tags": [ | ||
"fake:amd64-null-24-0" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"arm32v7-null-24-0": { | ||
"buildId": "arm32v7-null-24-0", | ||
"build": { | ||
"arch": "arm32v7", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"arm32v7": { | ||
"tags": [ | ||
"fake:arm32v7-null-24-0" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"amd64-null-25-23": { | ||
"buildId": "amd64-null-25-23", | ||
"build": { | ||
"arch": "amd64", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"amd64": { | ||
"tags": [ | ||
"fake:amd64-null-25-23" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"arm32v7-null-25-23": { | ||
"buildId": "arm32v7-null-25-23", | ||
"build": { | ||
"arch": "arm32v7", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"arm32v7": { | ||
"tags": [ | ||
"fake:arm32v7-null-25-23" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"amd64-null-25-24": { | ||
"buildId": "amd64-null-25-24", | ||
"build": { | ||
"arch": "amd64", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"amd64": { | ||
"tags": [ | ||
"fake:amd64-null-25-24" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"arm32v7-null-25-24": { | ||
"buildId": "arm32v7-null-25-24", | ||
"build": { | ||
"arch": "arm32v7", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"arm32v7": { | ||
"tags": [ | ||
"fake:arm32v7-null-25-24" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"amd64-{}-3-0": { | ||
"buildId": "amd64-{}-3-0", | ||
"build": { | ||
"arch": "amd64", | ||
"resolved": {} | ||
}, | ||
"source": { | ||
"arches": { | ||
"amd64": { | ||
"tags": [ | ||
"fake:amd64-{}-3-0" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"arm32v7-{}-3-0": { | ||
"buildId": "arm32v7-{}-3-0", | ||
"build": { | ||
"arch": "arm32v7", | ||
"resolved": {} | ||
}, | ||
"source": { | ||
"arches": { | ||
"arm32v7": { | ||
"tags": [ | ||
"fake:arm32v7-{}-3-0" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
[ | ||
{ | ||
"buildId": "arm32v7-null-1-0", | ||
"build": { | ||
"arch": "arm32v7", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"arm32v7": { | ||
"tags": [ | ||
"fake:arm32v7-null-1-0" | ||
] | ||
} | ||
} | ||
}, | ||
"identifier": "fake:arm32v7-null-1-0" | ||
}, | ||
{ | ||
"buildId": "arm32v7-null-23-0", | ||
"build": { | ||
"arch": "arm32v7", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"arm32v7": { | ||
"tags": [ | ||
"fake:arm32v7-null-23-0" | ||
] | ||
} | ||
} | ||
}, | ||
"identifier": "fake:arm32v7-null-23-0" | ||
}, | ||
{ | ||
"buildId": "arm32v7-null-25-24", | ||
"build": { | ||
"arch": "arm32v7", | ||
"resolved": null | ||
}, | ||
"source": { | ||
"arches": { | ||
"arm32v7": { | ||
"tags": [ | ||
"fake:arm32v7-null-25-24" | ||
] | ||
} | ||
} | ||
}, | ||
"identifier": "fake:arm32v7-null-25-24" | ||
} | ||
] | ||
{ | ||
"arm32v7-null-1-0": { | ||
"count": 2, | ||
"skips": 0, | ||
"identifier": "fake:arm32v7-null-1-0" | ||
}, | ||
"arm32v7-null-23-0": { | ||
"count": 24, | ||
"skips": 0, | ||
"identifier": "fake:arm32v7-null-23-0" | ||
}, | ||
"arm32v7-null-24-0": { | ||
"count": 24, | ||
"skips": 1, | ||
"identifier": "fake:arm32v7-null-24-0" | ||
}, | ||
"arm32v7-null-25-23": { | ||
"count": 25, | ||
"skips": 24, | ||
"identifier": "fake:arm32v7-null-25-23" | ||
}, | ||
"arm32v7-null-25-24": { | ||
"count": 26, | ||
"skips": 0, | ||
"identifier": "fake:arm32v7-null-25-24" | ||
} | ||
} | ||
2 |
Oops, something went wrong.