Skip to content

Commit e3f2673

Browse files
test: fix test cases
1 parent 3202872 commit e3f2673

File tree

4 files changed

+848
-75
lines changed

4 files changed

+848
-75
lines changed

lambdas/functions/control-plane/src/aws/runners.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ describe('create runner', () => {
318318
allocationStrategy: SpotAllocationStrategy.CAPACITY_OPTIMIZED,
319319
capacityType: 'spot',
320320
type: 'Org',
321+
scaleErrors: ['UnfulfillableCapacity', 'MaxSpotInstanceCountExceeded'],
321322
};
322323

323324
const defaultExpectedFleetRequestValues: ExpectedFleetRequestValues = {
@@ -755,6 +756,7 @@ describe('create runner with errors fail over to OnDemand', () => {
755756
capacityType: 'spot',
756757
type: 'Repo',
757758
onDemandFailoverOnError: ['InsufficientInstanceCapacity'],
759+
scaleErrors: ['UnfulfillableCapacity', 'MaxSpotInstanceCountExceeded'],
758760
};
759761
const defaultExpectedFleetRequestValues: ExpectedFleetRequestValues = {
760762
type: 'Repo',

lambdas/functions/control-plane/src/scale-runners/ScaleError.test.ts

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,42 @@ describe('ScaleError', () => {
2323

2424
describe('toBatchItemFailures', () => {
2525
const mockMessages: ActionRequestMessageSQS[] = [
26-
{ messageId: 'msg-1', id: 1, eventType: 'workflow_job' },
27-
{ messageId: 'msg-2', id: 2, eventType: 'workflow_job' },
28-
{ messageId: 'msg-3', id: 3, eventType: 'workflow_job' },
29-
{ messageId: 'msg-4', id: 4, eventType: 'workflow_job' },
26+
{
27+
messageId: 'msg-1',
28+
id: 1,
29+
eventType: 'workflow_job',
30+
repositoryName: 'repo',
31+
repositoryOwner: 'owner',
32+
installationId: 123,
33+
repoOwnerType: 'Organization',
34+
},
35+
{
36+
messageId: 'msg-2',
37+
id: 2,
38+
eventType: 'workflow_job',
39+
repositoryName: 'repo',
40+
repositoryOwner: 'owner',
41+
installationId: 123,
42+
repoOwnerType: 'Organization',
43+
},
44+
{
45+
messageId: 'msg-3',
46+
id: 3,
47+
eventType: 'workflow_job',
48+
repositoryName: 'repo',
49+
repositoryOwner: 'owner',
50+
installationId: 123,
51+
repoOwnerType: 'Organization',
52+
},
53+
{
54+
messageId: 'msg-4',
55+
id: 4,
56+
eventType: 'workflow_job',
57+
repositoryName: 'repo',
58+
repositoryOwner: 'owner',
59+
installationId: 123,
60+
repoOwnerType: 'Organization',
61+
},
3062
];
3163

3264
it.each([

0 commit comments

Comments
 (0)