Skip to content

Commit

Permalink
Fix existing test
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Oct 26, 2023
1 parent f8174af commit 6a336e9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
54 changes: 27 additions & 27 deletions src/ert/config/queue_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def from_dict(cls, config_dict: ConfigDict) -> QueueConfig:

if queue_options[selected_queue_system]:
_validate_queue_options(
queue_options[selected_queue_system], selected_queue_system
queue_options[selected_queue_system], selected_queue_system.name
)

if (
Expand Down Expand Up @@ -113,15 +113,15 @@ def generate_dict(option_list: List[Tuple[str, str]]) -> Dict[str, List[str]]:
)


memory_options: Mapping[QueueSystem, List[str]] = {
QueueSystem.LSF: [],
QueueSystem.SLURM: [],
QueueSystem.TORQUE: ["MEMORY_PER_JOB"],
QueueSystem.LOCAL: [],
memory_options: Mapping[str, List[str]] = {
"LSF": [],
"SLURM": [],
"TORQUE": ["MEMORY_PER_JOB"],
"LOCAL": [],
}

string_options: Mapping[QueueSystem, List[str]] = {
QueueSystem.LSF: [
string_options: Mapping[str, List[str]] = {
"LSF": [
"DEBUG_OUTPUT",
"LSF_RESOURCE",
"LSF_SERVER",
Expand All @@ -135,7 +135,7 @@ def generate_dict(option_list: List[Tuple[str, str]]) -> Dict[str, List[str]]:
"EXCLUDE_HOST",
"PROJECT_CODE",
],
QueueSystem.SLURM: [
"SLURM": [
"SBATCH",
"SCANCEL",
"SCONTROL",
Expand All @@ -144,56 +144,56 @@ def generate_dict(option_list: List[Tuple[str, str]]) -> Dict[str, List[str]]:
"INCLUDE_HOST",
"EXCLUDE_HOST",
],
QueueSystem.TORQUE: [
"TORQUE": [
"QSUB_CMD",
"QSTAT_CMD",
"QDEL_CMD",
"QSTAT_OPTIONS",
"QUEUE",
"DEBUG_OUTPUT",
],
QueueSystem.LOCAL: [],
"LOCAL": [],
}

positive_int_options: Mapping[QueueSystem, List[str]] = {
QueueSystem.LSF: [
positive_int_options: Mapping[str, List[str]] = {
"LSF": [
"BJOBS_TIMEOUT",
"MAX_RUNNING",
],
QueueSystem.SLURM: [
"SLURM": [
"MEMORY",
"MEMORY_PER_CPU",
"MAX_RUNNING",
],
QueueSystem.TORQUE: [
"TORQUE": [
"NUM_NODES",
"NUM_CPUS_PER_NODE",
"MAX_RUNNING",
],
QueueSystem.LOCAL: ["MAX_RUNNING"],
"LOCAL": ["MAX_RUNNING"],
}

float_options: Mapping[QueueSystem, List[str]] = {
QueueSystem.LSF: [
float_options: Mapping[str, List[str]] = {
"LSF": [
"SUBMIT_SLEEP",
],
QueueSystem.SLURM: [
"SLURM": [
"SQUEUE_TIMEOUT",
],
QueueSystem.TORQUE: ["SUBMIT_SLEEP", "QUEUE_QUERY_TIMEOUT"],
QueueSystem.LOCAL: [],
"TORQUE": ["SUBMIT_SLEEP", "QUEUE_QUERY_TIMEOUT"],
"LOCAL": [],
}

bool_options: Mapping[QueueSystem, List[str]] = {
QueueSystem.LSF: ["DEBUG_OUTPUT"],
QueueSystem.SLURM: [],
QueueSystem.TORQUE: [],
QueueSystem.LOCAL: [],
bool_options: Mapping[str, List[str]] = {
"LSF": ["DEBUG_OUTPUT"],
"SLURM": [],
"TORQUE": [],
"LOCAL": [],
}


def _validate_queue_options(
queue_options: List[Tuple[str, str]], queue_type: QueueSystem
queue_options: List[Tuple[str, str]], queue_type: str
) -> None:
for option_strings in queue_options:
option_name = option_strings[0]
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/config/test_ert_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def test_that_queue_config_dict_negative_value_invalid(
with config_generator(tmp_path_factory) as config_values:
config_dict = config_values.to_config_dict("test.ert", os.getcwd())
config_dict[ConfigKeys.QUEUE_OPTION].append(
["LSF", "MAX_RUNNING", "-6"],
[config_dict[ConfigKeys.QUEUE_SYSTEM], "MAX_RUNNING", "-6"],
)
with pytest.raises(
expected_exception=ConfigValidationError,
Expand Down

0 comments on commit 6a336e9

Please sign in to comment.