diff --git a/packages/aws-rfdk/lib/deadline/test/configure-spot-event-plugin.test.ts b/packages/aws-rfdk/lib/deadline/test/configure-spot-event-plugin.test.ts index 5707afd9f..4ae3f4ef1 100644 --- a/packages/aws-rfdk/lib/deadline/test/configure-spot-event-plugin.test.ts +++ b/packages/aws-rfdk/lib/deadline/test/configure-spot-event-plugin.test.ts @@ -996,73 +996,65 @@ describe('ConfigureSpotEventPlugin', () => { groupName = 'group_name1'; }); - describe('a fleet without vpcSunbets', () => { - beforeEach(() => { - // GIVEN - fleet = new SpotEventPluginFleet(stack, 'SpotFleet', { - vpc, - renderQueue: renderQueue, - deadlineGroups: [ - groupName, - ], - instanceTypes: [ - InstanceType.of(InstanceClass.T2, InstanceSize.SMALL), - ], - workerMachineImage, - maxCapacity: 1, - }); - - // WHEN - new ConfigureSpotEventPlugin(stack, 'ConfigureSpotEventPlugin', { - renderQueue, - vpc, - spotFleets: [fleet], - }); + test('a fleet without vpcSubnets specified => warns about dedicated subnets', () => { + // GIVEN + fleet = new SpotEventPluginFleet(stack, 'SpotFleet', { + vpc, + renderQueue: renderQueue, + deadlineGroups: [ + groupName, + ], + instanceTypes: [ + InstanceType.of(InstanceClass.T2, InstanceSize.SMALL), + ], + workerMachineImage, + maxCapacity: 1, }); - test('warns about dedicated subnets', () => { - // THEN - expect(fleet.node.metadataEntry).toContainEqual(expect.objectContaining({ - type: 'aws:cdk:warning', - data: 'Deadline Secrets Management is enabled on the Repository and VPC subnets have not been supplied. Using dedicated subnets is recommended. See https://github.com/aws/aws-rfdk/blobs/release/packages/aws-rfdk/lib/deadline/README.md#using-dedicated-subnets-for-deadline-components', - })); + // WHEN + new ConfigureSpotEventPlugin(stack, 'ConfigureSpotEventPlugin', { + renderQueue, + vpc, + spotFleets: [fleet], }); + + // THEN + expect(fleet.node.metadataEntry).toContainEqual(expect.objectContaining({ + type: 'aws:cdk:warning', + data: 'Deadline Secrets Management is enabled on the Repository and VPC subnets have not been supplied. Using dedicated subnets is recommended. See https://github.com/aws/aws-rfdk/blobs/release/packages/aws-rfdk/lib/deadline/README.md#using-dedicated-subnets-for-deadline-components', + })); }); - describe('a fleet with subnets specified', () => { - beforeEach(() => { - // GIVEN - fleet = new SpotEventPluginFleet(stack, 'SpotFleetWithSubnets', { - vpc, - vpcSubnets: { - subnetType: SubnetType.PRIVATE, - }, - renderQueue: renderQueue, - deadlineGroups: [ - groupName, - ], - instanceTypes: [ - InstanceType.of(InstanceClass.T2, InstanceSize.SMALL), - ], - workerMachineImage, - maxCapacity: 1, - }); + test('a fleet with vpcSubnets specified => does not warn about dedicated subnets', () => { + // GIVEN + fleet = new SpotEventPluginFleet(stack, 'SpotFleetWithSubnets', { + vpc, + vpcSubnets: { + subnetType: SubnetType.PRIVATE, + }, + renderQueue: renderQueue, + deadlineGroups: [ + groupName, + ], + instanceTypes: [ + InstanceType.of(InstanceClass.T2, InstanceSize.SMALL), + ], + workerMachineImage, + maxCapacity: 1, + }); - // WHEN - new ConfigureSpotEventPlugin(stack, 'ConfigureSpotEventPlugin', { - renderQueue, - vpc, - spotFleets: [fleet], - }); + // WHEN + new ConfigureSpotEventPlugin(stack, 'ConfigureSpotEventPlugin', { + renderQueue, + vpc, + spotFleets: [fleet], }); // THEN - test('does not warn about dedicated subnets', () => { - expect(fleet.node.metadataEntry).not.toContainEqual(expect.objectContaining({ - type: 'aws:cdk:warning', - data: expect.stringMatching(/dedicated subnet/i), - })); - }); + expect(fleet.node.metadataEntry).not.toContainEqual(expect.objectContaining({ + type: 'aws:cdk:warning', + data: expect.stringMatching(/dedicated subnet/i), + })); }); }); }); diff --git a/packages/aws-rfdk/lib/deadline/test/secrets-management.test.ts b/packages/aws-rfdk/lib/deadline/test/secrets-management.test.ts index c9052a5e6..c6f0c3eb2 100644 --- a/packages/aws-rfdk/lib/deadline/test/secrets-management.test.ts +++ b/packages/aws-rfdk/lib/deadline/test/secrets-management.test.ts @@ -587,7 +587,7 @@ describe('SecretsManagementIdentityRegistration', () => { expect(resolvedCalls).toContainEqual(expectedCall); }); - test('warns about dedicated subnets when ALB and source subnets match', () => { + test('warns about dedicated subnets when render queue ALB and source subnets match', () => { // GIVEN createTarget(); const dependent = new Construct(stack, 'Dependent'); diff --git a/packages/aws-rfdk/lib/deadline/test/usage-based-licensing.test.ts b/packages/aws-rfdk/lib/deadline/test/usage-based-licensing.test.ts index 9d47d67e8..11ad06c4f 100644 --- a/packages/aws-rfdk/lib/deadline/test/usage-based-licensing.test.ts +++ b/packages/aws-rfdk/lib/deadline/test/usage-based-licensing.test.ts @@ -121,43 +121,33 @@ describe('UsageBasedLicensing', () => { }); } - describe('vpcSubnets', () => { - describe('specified', () => { - let ubl: UsageBasedLicensing; - - // WHEN - beforeEach(() => { - ubl = createUbl({ - vpcSubnets: { - subnetType: SubnetType.PRIVATE, - }, - }); - }); + test('vpcSubnets specified => does not emit warnings', () => { + // GIVEN + const vpcSubnets: SubnetSelection = { + subnetType: SubnetType.PRIVATE, + }; - // THEN - test('does not emit warnings', () => { - expect(ubl.node.metadataEntry).not.toContainEqual(expect.objectContaining({ - type: 'aws:cdk:warning', - })); - }); + // WHEN + const ubl = createUbl({ + vpcSubnets, }); - describe('not specified', () => { - let ubl: UsageBasedLicensing; + // THEN + expect(ubl.node.metadataEntry).not.toContainEqual(expect.objectContaining({ + type: 'aws:cdk:warning', + data: expect.stringMatching(/dedicated subnet/i), + })); + }); - // WHEN - beforeEach(() => { - ubl = createUbl(); - }); + test('vpcSubnets not specified => emits warning about dedicated subnets', () => { + // WHEN + const ubl = createUbl(); - // THEN - test('emits warning about dedicated subnets', () => { - expect(ubl.node.metadataEntry).toContainEqual(expect.objectContaining({ - type: 'aws:cdk:warning', - data: 'Deadline Secrets Management is enabled on the Repository and VPC subnets have not been supplied. Using dedicated subnets is recommended. See https://github.com/aws/aws-rfdk/blobs/release/packages/aws-rfdk/lib/deadline/README.md#using-dedicated-subnets-for-deadline-components', - })); - }); - }); + // THEN + expect(ubl.node.metadataEntry).toContainEqual(expect.objectContaining({ + type: 'aws:cdk:warning', + data: 'Deadline Secrets Management is enabled on the Repository and VPC subnets have not been supplied. Using dedicated subnets is recommended. See https://github.com/aws/aws-rfdk/blobs/release/packages/aws-rfdk/lib/deadline/README.md#using-dedicated-subnets-for-deadline-components', + })); }); describe('configures auto registration', () => { diff --git a/packages/aws-rfdk/lib/deadline/test/worker-fleet.test.ts b/packages/aws-rfdk/lib/deadline/test/worker-fleet.test.ts index 4239b779a..5f52be894 100644 --- a/packages/aws-rfdk/lib/deadline/test/worker-fleet.test.ts +++ b/packages/aws-rfdk/lib/deadline/test/worker-fleet.test.ts @@ -1968,47 +1968,34 @@ describe('secrets management enabled', () => { props = { renderQueue, vpc, - workerMachineImage: new GenericWindowsImage({ - }), + workerMachineImage: new GenericWindowsImage({}), }; }); - describe('vpc subnets not specified', () => { - let workerInstanceFleet: WorkerInstanceFleet; - + test('vpc subnets not specified => warns about dedicated subnets', () => { // WHEN - beforeEach(() => { - workerInstanceFleet = new WorkerInstanceFleet(wfstack, 'WorkerInstanceFleet', props); - }); + const workerInstanceFleet = new WorkerInstanceFleet(wfstack, 'WorkerInstanceFleet', props); // THEN - test('warns about dedicated subnets', () => { - expect(workerInstanceFleet.node.metadataEntry).toContainEqual(expect.objectContaining({ - type: 'aws:cdk:warning', - data: 'Deadline Secrets Management is enabled on the Repository and VPC subnets have not been supplied. Using dedicated subnets is recommended. See https://github.com/aws/aws-rfdk/blobs/release/packages/aws-rfdk/lib/deadline/README.md#using-dedicated-subnets-for-deadline-components', - })); - }); + expect(workerInstanceFleet.node.metadataEntry).toContainEqual(expect.objectContaining({ + type: 'aws:cdk:warning', + data: 'Deadline Secrets Management is enabled on the Repository and VPC subnets have not been supplied. Using dedicated subnets is recommended. See https://github.com/aws/aws-rfdk/blobs/release/packages/aws-rfdk/lib/deadline/README.md#using-dedicated-subnets-for-deadline-components', + })); }); - describe('vpc subnets specified', () => { - let workerInstanceFleet: WorkerInstanceFleet; - + test('vpc subnets specified => does not emit dedicated subnets warning', () => { // WHEN - beforeEach(() => { - workerInstanceFleet = new WorkerInstanceFleet(wfstack, 'WorkerInstanceFleet', { - ...props, - vpcSubnets: { - subnetType: SubnetType.PRIVATE, - }, - }); + const workerInstanceFleet = new WorkerInstanceFleet(wfstack, 'WorkerInstanceFleet', { + ...props, + vpcSubnets: { + subnetType: SubnetType.PRIVATE, + }, }); // THEN - test('does not emit dedicated subnets warning', () => { - expect(workerInstanceFleet.node.metadataEntry).not.toContainEqual(expect.objectContaining({ - type: 'aws:cdk:warning', - data: expect.stringMatching(/dedicated subnet/i), - })); - }); + expect(workerInstanceFleet.node.metadataEntry).not.toContainEqual(expect.objectContaining({ + type: 'aws:cdk:warning', + data: expect.stringMatching(/dedicated subnet/i), + })); }); });