|
1 |
| -import { Template, Match } from '../../../assertions'; |
| 1 | +import { Template } from '../../../assertions'; |
2 | 2 | import * as iam from '../../../aws-iam';
|
3 | 3 | import * as sfn from '../../../aws-stepfunctions';
|
4 | 4 | import * as cdk from '../../../core';
|
@@ -883,7 +883,12 @@ test('Create Cluster with Instances configuration', () => {
|
883 | 883 | });
|
884 | 884 | });
|
885 | 885 |
|
886 |
| -test('Create Cluster with InstanceFleet with allocation strategy=capacity-optimized for Spot instances', () => { |
| 886 | +test.each([ |
| 887 | + [EmrCreateCluster.SpotAllocationStrategy.CAPACITY_OPTIMIZED, 'capacity-optimized'], |
| 888 | + [EmrCreateCluster.SpotAllocationStrategy.PRICE_CAPACITY_OPTIMIZED, 'price-capacity-optimized'], |
| 889 | + [EmrCreateCluster.SpotAllocationStrategy.LOWEST_PRICE, 'lowest-price'], |
| 890 | + [EmrCreateCluster.SpotAllocationStrategy.DIVERSIFIED, 'diversified'], |
| 891 | +])('Create Cluster with InstanceFleet with allocation strategy %s for Spot instances', (strategy, expected) => { |
887 | 892 | // WHEN
|
888 | 893 | const task = new EmrCreateCluster(stack, 'Task', {
|
889 | 894 | instances: {
|
@@ -913,7 +918,7 @@ test('Create Cluster with InstanceFleet with allocation strategy=capacity-optimi
|
913 | 918 | }],
|
914 | 919 | launchSpecifications: {
|
915 | 920 | spotSpecification: {
|
916 |
| - allocationStrategy: EmrCreateCluster.SpotAllocationStrategy.CAPACITY_OPTIMIZED, |
| 921 | + allocationStrategy: strategy, |
917 | 922 | blockDurationMinutes: 1,
|
918 | 923 | timeoutAction: EmrCreateCluster.SpotTimeoutAction.TERMINATE_CLUSTER,
|
919 | 924 | timeoutDurationMinutes: 5,
|
@@ -975,7 +980,7 @@ test('Create Cluster with InstanceFleet with allocation strategy=capacity-optimi
|
975 | 980 | }],
|
976 | 981 | LaunchSpecifications: {
|
977 | 982 | SpotSpecification: {
|
978 |
| - AllocationStrategy: 'capacity-optimized', |
| 983 | + AllocationStrategy: expected, |
979 | 984 | BlockDurationMinutes: 1,
|
980 | 985 | TimeoutAction: 'TERMINATE_CLUSTER',
|
981 | 986 | TimeoutDurationMinutes: 5,
|
|
0 commit comments