Skip to content

Commit

Permalink
Use resinsightdaily in test_ri_wellmod
Browse files Browse the repository at this point in the history
Remove xfail pytestmark
Skip tests failing online on github runners

These tests were all marked as xfail before, and they still fail due to either
resinsight or lack of drogon/reek data.
  • Loading branch information
andreas-el committed Mar 4, 2024
1 parent 289e48d commit 0dc1684
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions tests/test_ri_wellmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import pytest
from subscript.ri_wellmod import ri_wellmod

pytestmark = pytest.mark.xfail()

SCRIPTNAME = "ri_wellmod"
DATAPATH = Path(__file__).parent / "testdata_ri_wellmod"
RI_DEV = "/project/res/x86_64_RH_7/share/resinsight/jenkins_dev/ResInsight"
RI_DEV = "/project/res/bin/resinsightdev"

try:
# pylint: disable=unused-import
Expand Down Expand Up @@ -62,6 +60,14 @@ def file_contains(filename, string_to_find):
return filetext.find(string_to_find) >= 0


def github_online_runner():
gh_runner = os.getenv("GITHUB_ACTIONS") == "true"

# we still want to run tests on github actions local (komodo) runners
local_gh_runner = "f_scout_ci" in str(os.getenv("RUNNER_NAME"))
return gh_runner and not local_gh_runner


@pytest.mark.integration
def test_integration():
"""Test that endpoint is installed"""
Expand All @@ -85,6 +91,9 @@ def test_main_initcase(tmp_path, mocker):
assert Path(outfile).exists() and file_contains(outfile, "A4")


@pytest.mark.skipif(
github_online_runner(), reason="Cannot test on github online runner"
)
@pytest.mark.skipif(
not has_resinsight(),
reason="Could not find a ResInsight executable",
Expand Down Expand Up @@ -232,6 +241,9 @@ def test_ert_forward_model(tmp_path):


# REEK TESTS
@pytest.mark.skipif(
github_online_runner(), reason="Cannot test on github online runner"
)
@pytest.mark.skipif(
not has_resinsight(), reason="Could not find a ResInsight executable"
)
Expand All @@ -248,6 +260,9 @@ def test_main_initcase_reek(tmp_path, mocker):
assert Path(outfile).exists() and file_contains(outfile, "OP_1")


@pytest.mark.skipif(
github_online_runner(), reason="Cannot test on github online runner"
)
@pytest.mark.skipif(
not has_resinsight(), reason="Could not find a ResInsight executable"
)
Expand Down

0 comments on commit 0dc1684

Please sign in to comment.