Skip to content

Commit

Permalink
Disable some tests when running on github actions online runners.
Browse files Browse the repository at this point in the history
The saame tests should be run on github local runners.
  • Loading branch information
Andreas Eknes Lie (EDT DSD SD2) committed Mar 4, 2024
1 parent 3a33925 commit 1d90a2c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_ri_wellmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ 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 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 @@ -83,6 +92,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 run test on github online runner"
)
@pytest.mark.skipif(
not has_resinsight(),
reason="Could not find a ResInsight executable",
Expand Down Expand Up @@ -230,6 +242,9 @@ def test_ert_forward_model(tmp_path):


# REEK TESTS
@pytest.mark.skipif(
github_online_runner(), reason="Cannot run test on github online runner"
)
@pytest.mark.skipif(
not has_resinsight(), reason="Could not find a ResInsight executable"
)
Expand All @@ -246,6 +261,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 run test on github online runner"
)
@pytest.mark.skipif(
not has_resinsight(), reason="Could not find a ResInsight executable"
)
Expand Down

0 comments on commit 1d90a2c

Please sign in to comment.