Skip to content

Commit

Permalink
Let Jenkins skip the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisherlevine committed Oct 28, 2024
1 parent ede270a commit ef92e9a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_bestEffortIsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BestEffortIsrTestCase(lsst.utils.tests.TestCase):
def setUpClass(cls):
try:
cls.bestEffortIsr = BestEffortIsr()
except FileNotFoundError:
except (FileNotFoundError, ValueError):
raise unittest.SkipTest("Skipping tests that require the LATISS butler repo.")

# chosen as this is available in the following locations - collections:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_butlerUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
getMostRecentDayObs,
getSeqNum,
getSeqNumsForDayObs,
getSite,
makeDefaultLatissButler,
sanitizeDayObs,
sortRecordsByDayObsThenSeqNum,
Expand All @@ -73,6 +74,8 @@ def setUp(self):

# butler stuff
try:
if getSite() == "jenkins":
raise unittest.SkipTest("Skip running butler-driven tests in Jenkins.")
self.butler = makeDefaultLatissButler()
except FileNotFoundError:
raise unittest.SkipTest("Skipping tests that require the LATISS butler repo.")
Expand Down Expand Up @@ -454,6 +457,8 @@ def test_makeDefaultLatissButlerRaiseTypes(self):
"""makeDefaultLatissButler unifies the mixed exception types from
butler inits, so test all available possibilities here.
"""
if getSite() == "jenkins":
raise unittest.SkipTest("Skip running butler-driven tests in Jenkins.")
with unittest.mock.patch.dict("os.environ"):
if "DAF_BUTLER_REPOSITORY_INDEX" in os.environ: # can't del unless it's already there
del os.environ["DAF_BUTLER_REPOSITORY_INDEX"]
Expand Down
3 changes: 3 additions & 0 deletions tests/test_imageExaminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@
from lsst.summit.utils import ImageExaminer
from lsst.summit.utils.bestEffort import BestEffortIsr
from lsst.summit.utils.butlerUtils import makeDefaultLatissButler
from lsst.summit.utils.utils import getSite


class ImageExaminerTestCase(lsst.utils.tests.TestCase):
@classmethod
def setUpClass(cls):
try:
if getSite() == "jenkins":
raise unittest.SkipTest("Skip running butler-driven tests in Jenkins.")
cls.butler = makeDefaultLatissButler()
except FileNotFoundError:
raise unittest.SkipTest("Skipping tests that require the LATISS butler repo.")
Expand Down
3 changes: 3 additions & 0 deletions tests/test_nightReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@

import lsst.summit.utils.butlerUtils as butlerUtils # noqa: E402
from lsst.summit.utils.nightReport import ColorAndMarker, NightReport # noqa: E402
from lsst.summit.utils.utils import getSite # noqa: E402


class NightReportTestCase(lsst.utils.tests.TestCase):
@classmethod
def setUpClass(cls):
try:
if getSite() == "jenkins":
raise unittest.SkipTest("Skip running butler-driven tests in Jenkins.")
cls.butler = butlerUtils.makeDefaultLatissButler()
except FileNotFoundError:
raise unittest.SkipTest("Skipping tests that require the LATISS butler repo.")
Expand Down

0 comments on commit ef92e9a

Please sign in to comment.