Skip to content

Commit 77fdf75

Browse files
author
Himani Anil Deshpande
committed
Revert "Add unit tests"
This reverts commit eff1587.
1 parent 314f60f commit 77fdf75

File tree

1 file changed

+1
-115
lines changed

1 file changed

+1
-115
lines changed

test/unit/slurm/test_fleet_config_generator.py

Lines changed: 1 addition & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import pytest
1414
from assertpy import assert_that
15-
from pcluster_fleet_config_generator import ConfigurationFieldNotFoundError, CriticalError, generate_fleet_config_file, get_total_min_count
15+
from pcluster_fleet_config_generator import ConfigurationFieldNotFoundError, CriticalError, generate_fleet_config_file
1616

1717

1818
@pytest.mark.parametrize(
@@ -266,117 +266,3 @@ def _assert_files_are_equal(file, expected_file):
266266
expected_file_content = exp_f.read()
267267
expected_file_content = expected_file_content.replace("<DIR>", os.path.dirname(file))
268268
assert_that(f.read()).is_equal_to(expected_file_content)
269-
270-
@pytest.mark.parametrize(
271-
"cluster_config, expected_exception, expected_message, expected_total_min_count",
272-
[
273-
({}, CriticalError, "Unable to find key 'Scheduling' in the configuration file", 0),
274-
({"Scheduling": {}}, CriticalError, "Unable to find key 'SlurmQueues' in the configuration file", 0),
275-
({"Scheduling": {"SlurmQueues": []}}, None, None, 0),
276-
(
277-
{
278-
"Scheduling": {
279-
"SlurmQueues": [
280-
{
281-
"Name": "q1",
282-
"CapacityType": "ONDEMAND",
283-
"ComputeResources": [
284-
{"MinCount": 0, "Instances": [{"InstanceType": "test"}]},
285-
],
286-
}
287-
]
288-
}
289-
},
290-
None,
291-
None,0,
292-
),
293-
(
294-
{
295-
"Scheduling": {
296-
"SlurmQueues": [
297-
{
298-
"Name": "q1",
299-
"CapacityType": "ONDEMAND",
300-
"ComputeResources": [
301-
{"MinCount": 2, "Instances": [{"InstanceType": "test"}]},
302-
{"MinCount": 3, "InstanceType": "test"},
303-
],
304-
}
305-
]
306-
}
307-
},
308-
None,
309-
None,5,
310-
),
311-
(
312-
{
313-
"Scheduling": {
314-
"SlurmQueues": [
315-
{
316-
"Name": "q1",
317-
"CapacityType": "SPOT",
318-
"ComputeResources": [
319-
{
320-
"Name": "cr1",
321-
"Instances": [{"InstanceType": "test"}, {"InstanceType": "test-2"}],
322-
"MinCount": 3,
323-
"SpotPrice": "10",
324-
},
325-
{"Name": "cr2", "InstanceType": "test", "SpotPrice": "10", "MinCount": 9},
326-
],
327-
"Networking": {"SubnetIds": ["123", "456", "789"]},
328-
}
329-
]
330-
}
331-
},
332-
None,
333-
None,12,
334-
),
335-
(
336-
{
337-
"Scheduling": {
338-
"SlurmQueues": [
339-
{
340-
"Name": "q1",
341-
"CapacityType": "CAPACITY_BLOCK",
342-
"ComputeResources": [
343-
{
344-
"Name": "cr1",
345-
"Instances": [{"InstanceType": "test"}],
346-
"MinCount":2,
347-
"CapacityReservationTarget": {
348-
"CapacityReservationResourceGroupArn": "arn",
349-
},
350-
},
351-
{
352-
"Name": "cr2",
353-
"MinCount":2,
354-
"Instances": [{"InstanceType": "test"}],
355-
"CapacityReservationTarget": {
356-
"CapacityReservationId": "id",
357-
},
358-
},
359-
],
360-
"Networking": {"SubnetIds": ["123"]},
361-
}
362-
]
363-
}
364-
},
365-
None,
366-
None,4,
367-
),
368-
],
369-
)
370-
def test_get_total_min_count(
371-
mocker, tmpdir, cluster_config, expected_exception, expected_message, expected_total_min_count
372-
):
373-
mocker.patch("pcluster_fleet_config_generator._load_cluster_config", return_value=cluster_config)
374-
375-
if expected_message:
376-
with pytest.raises(expected_exception, match=expected_message):
377-
actual_min_count = get_total_min_count(input_file="fake")
378-
assert_that(actual_min_count).is_equal_to(expected_total_min_count)
379-
380-
else:
381-
actual_min_count = get_total_min_count(input_file="fake")
382-
assert_that(actual_min_count).is_equal_to(expected_total_min_count)

0 commit comments

Comments
 (0)