Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions q2_vizard/tests/test_boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from qiime2.plugin.testing import TestPluginBase
from qiime2 import Metadata
from .test_util import skip_selenium

from q2_vizard import boxplot

Expand Down Expand Up @@ -377,6 +378,7 @@ def _selenium_boxplot_test(
self.assertEqual(exp, obs)

# run selenium tests using a headless chrome driver
@skip_selenium
def test_boxplot_chrome(self):
chrome_options = ChromeOptions()
chrome_options.add_argument('-headless')
Expand Down Expand Up @@ -405,6 +407,7 @@ def test_boxplot_chrome(self):
exp_single_box_outlier_marks_len)

# run selenium tests using a headless firefox driver
@skip_selenium
def test_boxplot_firefox(self):
firefox_options = FirefoxOptions()
firefox_options.add_argument('-headless')
Expand Down
3 changes: 3 additions & 0 deletions q2_vizard/tests/test_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from qiime2.plugin.testing import TestPluginBase

from q2_vizard.heatmap import heatmap
from .test_util import skip_selenium


class TestHeatmap(TestPluginBase):
Expand Down Expand Up @@ -106,6 +107,7 @@ def _selenium_heatmap_test(self, driver, x_measure, y_measure,
self.assertEqual(mark_gradient, exp_gradient_mark)

# run selenium checks with a chrome driver
@skip_selenium
def test_heatmap_chrome(self):
chrome_options = ChromeOptions()
chrome_options.add_argument('-headless')
Expand Down Expand Up @@ -133,6 +135,7 @@ def test_heatmap_chrome(self):
exp_y_mark, exp_gradient_mark, exp_mark_id)

# run selenium checks with a firefox driver
@skip_selenium
def test_heatmap_firefox(self):
firefox_options = FirefoxOptions()
firefox_options.add_argument('-headless')
Expand Down
3 changes: 3 additions & 0 deletions q2_vizard/tests/test_lineplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from qiime2 import Metadata

from q2_vizard import lineplot
from .test_util import skip_selenium


class TestLineplot(TestPluginBase):
Expand Down Expand Up @@ -174,6 +175,7 @@ def _selenium_lineplot_test(self, driver, x_measure, y_measure,
self.assertIn(exp_text, page_source)

# run selenium checks with a chrome driver
@skip_selenium
def test_lineplot_chrome(self):
chrome_options = ChromeOptions()
chrome_options.add_argument('-headless')
Expand Down Expand Up @@ -202,6 +204,7 @@ def test_lineplot_chrome(self):
exp_marks_len, exp_mark_id, exp_x_mark, exp_y_mark,
exp_y_measure)

@skip_selenium
def test_lineplot_firefox(self):
firefox_options = FirefoxOptions()
firefox_options.add_argument('-headless')
Expand Down
3 changes: 3 additions & 0 deletions q2_vizard/tests/test_scatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from qiime2.plugin.testing import TestPluginBase

from q2_vizard.scatterplot import scatterplot_2d
from .test_util import skip_selenium


class TestScatterplot(TestPluginBase):
Expand Down Expand Up @@ -122,6 +123,7 @@ def _dropdown_util(field, exp):
self.assertEqual(mark_y, exp_y_mark)

# run selenium checks with a chrome driver
@skip_selenium
def test_scatterplot_chrome(self):
chrome_options = ChromeOptions()
chrome_options.add_argument('-headless')
Expand Down Expand Up @@ -149,6 +151,7 @@ def test_scatterplot_chrome(self):
exp_x_measure, exp_y_measure, exp_color_measure)

# run selenium checks with a firefox driver
@skip_selenium
def test_scatterplot_firefox(self):
firefox_options = FirefoxOptions()
firefox_options.add_argument('-headless')
Expand Down
14 changes: 14 additions & 0 deletions q2_vizard/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@
# ----------------------------------------------------------------------------

import pandas as pd
import pytest
import os

from qiime2.plugin.testing import TestPluginBase
from qiime2 import Metadata

from .._util import _col_type_validation, _measure_validation

# This is a temporary 'fix' to failing selenium tests when they are run
# within a container on the GHA linux runner.
# The failures aren't interesting and the hope is that this will either be
# fixed such that:
# A. None of the tests are run within a container, or
# B. The chrome & firefox tests on mac will fill in enough gaps
# that we can see if something goes wrong that is interesting.
skip_selenium = pytest.mark.skipif(
os.getenv('SKIP_SELENIUM', '') == '1',
reason='skipping Selenium tests within linux container'
)


class TestBase(TestPluginBase):
package = 'q2_vizard.tests'
Expand Down
Loading