Skip to content

Commit

Permalink
Merge pull request #15 from mjanardhan/fix-ray-integ-tests
Browse files Browse the repository at this point in the history
WorkerType and numberofWorkers defaults are enforced when not set
  • Loading branch information
natalie-white-aws authored Jul 23, 2024
2 parents df4b1d0 + c077b11 commit 79339c4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
4 changes: 0 additions & 4 deletions packages/@aws-cdk/aws-glue-alpha/lib/jobs/ray-job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ export class RayJob extends Job {
throw new Error('Ray jobs only support Z.2X worker type');
};

if ((!props.workerType && props.numberOfWorkers !== undefined) || (props.workerType && props.numberOfWorkers === undefined)) {
throw new Error('Both workerType and numberOFWorkers must be set');
}

const jobResource = new CfnJob(this, 'Resource', {
name: props.jobName,
description: props.description,
Expand Down
26 changes: 0 additions & 26 deletions packages/@aws-cdk/aws-glue-alpha/test/ray-job.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ describe('Job', () => {
}),
});
});

test('Default numberOfWorkers should be 3', () => {
Template.fromStack(stack).hasResourceProperties('AWS::Glue::Job', {
NumberOfWorkers: 3,
});
});
});

describe('Create new Ray Job with log override parameters', () => {
Expand Down Expand Up @@ -264,25 +258,5 @@ describe('Job', () => {
});
}).toThrow(new Error('Ray jobs only support Z.2X worker type'));
});

test('Create Ray Job overriding only workerType to cause an Error', () => {
expect(() => {
job = new glue.RayJob(stack, 'RayJob', {
role,
script,
workerType: glue.WorkerType.Z_2X,
});
}).toThrow(new Error('Both workerType and numberOFWorkers must be set'));
});

test('Create Ray Job overriding only numberOfWorkers to cause an Error', () => {
expect(() => {
job = new glue.RayJob(stack, 'RayJob', {
role,
script,
numberOfWorkers: 5,
});
}).toThrow(new Error('Both workerType and numberOFWorkers must be set'));
});
});
});

0 comments on commit 79339c4

Please sign in to comment.