Skip to content

Commit a2cc849

Browse files
committed
Conditionally skip GeoTrellis tests if on CircleCI
Signed-off-by: Jason T. Brown <[email protected]>
1 parent 98781d1 commit a2cc849

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pyrasterframes/src/main/python/tests/GeotrellisTests.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@
2121
import tempfile
2222
import pathlib
2323
from . import TestEnvironment
24+
from unittest import skipIf
25+
import os
2426

2527

2628
class GeotrellisTests(TestEnvironment):
2729

30+
on_circle_ci = os.environ.get('CIRCLECI', 'false') == 'true'
31+
32+
@skipIf(on_circle_ci, 'CircleCI has java.lang.NoClassDefFoundError fs2/Stream when taking action on rf_gt')
2833
def test_write_geotrellis_layer(self):
2934
rf = self.spark.read.geotiff(self.img_uri).cache()
3035
rf_count = rf.count()
@@ -41,13 +46,13 @@ def test_write_geotrellis_layer(self):
4146
rf_gt_count = rf_gt.count()
4247
self.assertTrue(rf_gt_count > 0)
4348

44-
# maybe CI is unhappy about print / show.
4549
_ = rf_gt.take(1)
4650

4751
shutil.rmtree(dest, ignore_errors=True)
4852

53+
@skipIf(on_circle_ci, 'CircleCI has java.lang.NoClassDefFoundError fs2/Stream when taking action on rf_gt')
4954
def test_write_geotrellis_multiband_layer(self):
50-
rf = self.spark.read.geotiff(self.img_rgb_uri)
55+
rf = self.spark.read.geotiff(self.img_rgb_uri).cache()
5156
rf_count = rf.count()
5257
self.assertTrue(rf_count > 0)
5358

@@ -62,7 +67,6 @@ def test_write_geotrellis_multiband_layer(self):
6267
rf_gt_count = rf_gt.count()
6368
self.assertTrue(rf_gt_count > 0)
6469

65-
# maybe CI is unhappy about print / show.
6670
_ = rf_gt.take(1)
6771

6872
shutil.rmtree(dest, ignore_errors=True)

0 commit comments

Comments
 (0)