Skip to content

Commit

Permalink
ci: skip local2global tests in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
abhidg committed Nov 15, 2024
1 parent 180fe48 commit f5dee08
Showing 1 changed file with 37 additions and 8 deletions.
45 changes: 37 additions & 8 deletions tests/test_local2global.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Test local2global reconstruction"""

import os
import sys
from copy import copy
from statistics import mean
Expand Down Expand Up @@ -82,6 +83,10 @@ def iter_seed(it: int) -> None:
ut.seed(it_seed.spawn(1)[0])


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS") == "true",
reason="local2global tests disabled in GitHub Actions"
)
@pytest.mark.parametrize("it", range(100))
@pytest.mark.parametrize("problem_cls", test_classes)
@pytest.mark.parametrize("patches,min_overlap", zip(patches_list, MIN_OVERLAP))
Expand Down Expand Up @@ -110,7 +115,10 @@ def test_stability(it, problem_cls, patches, min_overlap):
print(f"Mean error is {error}")
assert error < TOL


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS") == "true",
reason="local2global tests disabled in GitHub Actions"
)
@pytest.mark.parametrize("problem_cls", test_classes)
@pytest.mark.parametrize("patches,min_overlap", zip(patches_list, MIN_OVERLAP))
def test_calc_synchronised_rotations(problem_cls, patches, min_overlap):
Expand All @@ -134,7 +142,10 @@ def test_calc_synchronised_rotations(problem_cls, patches, min_overlap):
print(f"Mean error is {error}")
assert error < TOL


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS") == "true",
reason="local2global tests disabled in GitHub Actions"
)
@pytest.mark.xfail(reason="Noisy tests may fail, though many failures are a bad sign")
@pytest.mark.parametrize("test_class", test_classes)
@pytest.mark.parametrize("noise", NOISE_SCALES)
Expand Down Expand Up @@ -179,7 +190,10 @@ def test_noisy_calc_synchronised_rotations(noise, test_class, patches, min_overl
)
assert error < max(max_err, TOL)


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS") == "true",
reason="local2global tests disabled in GitHub Actions"
)
@pytest.mark.parametrize("problem_cls", test_classes)
@pytest.mark.parametrize("patches,min_overlap", zip(patches_list, MIN_OVERLAP))
def test_calc_synchronised_scales(problem_cls, patches, min_overlap):
Expand All @@ -204,7 +218,10 @@ def test_calc_synchronised_scales(problem_cls, patches, min_overlap):
print(f"Mean error is {error}")
assert error < TOL


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS") == "true",
reason="local2global tests disabled in GitHub Actions"
)
@pytest.mark.xfail(reason="Noisy tests may fail, though many failures are a bad sign")
@pytest.mark.parametrize("problem_cls", test_classes)
@pytest.mark.parametrize("noise", NOISE_SCALES)
Expand Down Expand Up @@ -252,7 +269,10 @@ def test_noisy_calc_synchronised_scales(problem_cls, noise, patches, min_overlap
)
assert error < max_err + TOL


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS") == "true",
reason="local2global tests disabled in GitHub Actions"
)
@pytest.mark.parametrize("problem_cls", test_classes)
@pytest.mark.parametrize("patches,min_overlap", zip(patches_list, MIN_OVERLAP))
def test_calc_synchronised_translations(problem_cls, patches, min_overlap):
Expand All @@ -275,7 +295,10 @@ def test_calc_synchronised_translations(problem_cls, patches, min_overlap):
print(f"Mean error is {error}")
assert error < TOL


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS") == "true",
reason="local2global tests disabled in GitHub Actions"
)
@pytest.mark.xfail(reason="Noisy tests may fail, though many failures are a bad sign")
@pytest.mark.parametrize("noise", NOISE_SCALES)
@pytest.mark.parametrize("patches,min_overlap", zip(patches_list, MIN_OVERLAP))
Expand All @@ -300,7 +323,10 @@ def test_noisy_calc_synchronised_translations(noise, patches, min_overlap):
print(f"Mean error is {error}")
assert error < noise + TOL


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS") == "true",
reason="local2global tests disabled in GitHub Actions"
)
@pytest.mark.parametrize("problem_cls", test_classes)
@pytest.mark.parametrize(
"patches,min_overlap,points", zip(patches_list, MIN_OVERLAP, points_list)
Expand Down Expand Up @@ -329,7 +355,10 @@ def test_get_aligned_embedding(problem_cls, patches, min_overlap, points):
print(f"Procrustes error is {error}")
assert error < TOL


@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS") == "true",
reason="local2global tests disabled in GitHub Actions"
)
@pytest.mark.xfail(reason="Noisy tests may fail, though many failures are a bad sign")
@pytest.mark.parametrize("problem_cls", test_classes)
@pytest.mark.parametrize("it", range(3))
Expand Down

0 comments on commit f5dee08

Please sign in to comment.