Skip to content

Commit

Permalink
Simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Jan 17, 2025
1 parent 749a7b8 commit e8f8737
Showing 1 changed file with 7 additions and 45 deletions.
52 changes: 7 additions & 45 deletions tests/everest/test_detached.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

import pytest
import requests
import yaml

import everest
from ert.config import ErtConfig, QueueSystem
from ert.config import QueueSystem
from ert.config.queue_config import (
LocalQueueOptions,
LsfQueueOptions,
Expand All @@ -20,7 +21,6 @@
from everest.config.server_config import ServerConfig
from everest.config.simulator_config import SimulatorConfig
from everest.detached import (
_EVERSERVER_JOB_PATH,
PROXY,
ServerStatus,
everserver_status,
Expand All @@ -31,12 +31,6 @@
wait_for_server,
wait_for_server_to_stop,
)
from everest.strings import (
DEFAULT_OUTPUT_DIR,
DETACHED_NODE_DIR,
EVEREST_SERVER_CONFIG,
SIMULATION_DIR,
)
from everest.util import makedirs_if_needed


Expand Down Expand Up @@ -150,43 +144,11 @@ def test_wait_for_server(server_is_running_mock, caplog, monkeypatch):
assert not caplog.messages


def _get_reference_config():
everest_config = EverestConfig.load_file("config_minimal.yml")
reference_config = ErtConfig.read_site_config()
cwd = os.getcwd()
reference_config.update(
{
"INSTALL_JOB": [(EVEREST_SERVER_CONFIG, _EVERSERVER_JOB_PATH)],
"QUEUE_SYSTEM": "LOCAL",
"JOBNAME": EVEREST_SERVER_CONFIG,
"MAX_SUBMIT": 1,
"NUM_REALIZATIONS": 1,
"RUNPATH": os.path.join(
cwd,
DEFAULT_OUTPUT_DIR,
DETACHED_NODE_DIR,
SIMULATION_DIR,
),
"FORWARD_MODEL": [
[
EVEREST_SERVER_CONFIG,
"--config-file",
os.path.join(cwd, "config_minimal.yml"),
],
],
"ENSPATH": os.path.join(
cwd, DEFAULT_OUTPUT_DIR, DETACHED_NODE_DIR, EVEREST_SERVER_CONFIG
),
"RUNPATH_FILE": os.path.join(
cwd, DEFAULT_OUTPUT_DIR, DETACHED_NODE_DIR, ".res_runpath_list"
),
}
)
return everest_config, reference_config


def test_detached_mode_config_base(copy_math_func_test_data_to_tmp):
everest_config, _ = _get_reference_config()
def test_detached_mode_config_base(min_config, monkeypatch, tmp_path):
monkeypatch.chdir(tmp_path)
with open("config.yml", "w", encoding="utf-8") as fout:
yaml.dump(min_config, fout)
everest_config = EverestConfig.load_file("config.yml")
assert everest_config.simulator.queue_system == LocalQueueOptions(max_running=8)


Expand Down

0 comments on commit e8f8737

Please sign in to comment.