Skip to content

Commit

Permalink
Add test that can run on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
javerbukh committed Dec 13, 2024
1 parent fdef225 commit 41b51f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci_cron_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
ci_cron_tests_stable_strauss:
name: Python 3.12 with stable versions of dependencies and Strauss
runs-on: ubuntu-latest
if: (CI == false && (github.repository == 'spacetelescope/jdaviz' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Extra CI'))))
if: (github.repository == 'spacetelescope/jdaviz' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Extra CI')))
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import os
import pytest
from specutils import SpectralRegion
import astropy.units as u

pytest.importorskip("strauss")
IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"


@pytest.mark.skipif(IN_GITHUB_ACTIONS, reason="Test requires computer with audio output.")
def test_sonify_data(cubeviz_helper, spectrum1d_cube_larger):
cubeviz_helper.load_data(spectrum1d_cube_larger, data_label="test")
sonify_plg = cubeviz_helper.app.get_tray_item_from_name('cubeviz-sonify-data')
Expand Down Expand Up @@ -32,3 +35,8 @@ def test_sonify_data(cubeviz_helper, spectrum1d_cube_larger):
assert sonify_plg.flux_viewer.stream_active is False
sonify_plg.vue_start_stop_stream()
assert sonify_plg.flux_viewer.stream_active


def test_sonify_data_does_not_break_other_things(cubeviz_helper, spectrum1d_cube_larger):
cubeviz_helper.load_data(spectrum1d_cube_larger, data_label="test")
assert len(cubeviz_helper.app.data_collection) > 0

0 comments on commit 41b51f6

Please sign in to comment.