Skip to content

Commit

Permalink
TEMP
Browse files Browse the repository at this point in the history
  • Loading branch information
matrss committed Feb 27, 2024
1 parent ae89581 commit 2c3a674
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/testing-all-oses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["macos-12", "macos-14", "ubuntu-latest", "windows-latest"]
os: ["macos-14", "ubuntu-latest"]
order: ["normal", "reverse"]
headless-method: ["env QT_QPA_PLATFORM=offscreen"]
include:
- os: "ubuntu-latest"
order: "normal"
headless-method: "xvfb-run"
- os: "ubuntu-latest"
order: "reverse"
headless-method: "xvfb-run"
# os: ["macos-12", "macos-14", "ubuntu-latest", "windows-latest"]
# order: ["normal", "reverse"]
# headless-method: ["env QT_QPA_PLATFORM=offscreen"]
# include:
# - os: "ubuntu-latest"
# order: "normal"
# headless-method: "xvfb-run"
# - os: "ubuntu-latest"
# order: "reverse"
# headless-method: "xvfb-run"

steps:
# This workaround is necessary because PyFilesystem2 throws an InvalidCharsInPath error:
Expand Down Expand Up @@ -59,7 +62,7 @@ jobs:
cache-environment-key: environment-${{ steps.year-and-week.outputs.year-and-week }}
- name: Run tests
timeout-minutes: 5
run: micromamba run -n ci ${{ matrix.headless-method }} pytest -v -n logical --durations=20 --cov=mslib
run: micromamba run -n ci ${{ matrix.headless-method }} pytest -s -v -n logical --durations=20 --cov=mslib
${{ (matrix.order == 'normal' && ' ') || (matrix.order == 'reverse' && '--reverse') }} tests
- name: Collect coverage
env:
Expand Down
3 changes: 3 additions & 0 deletions tests/_test_mswms/test_mss_plot_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ def test_VS_gallery_template(self):
# ToDo Test Data have to be written to a random tmp dir and that may become purged afterwards
templates_location = os.path.join(mslib.mswms.gallery_builder.DOCS_LOCATION, "plot_examples")
sys.path.append(templates_location)
import pathlib
print(f"{templates_location=}", file=sys.stderr)
print(f'{list(pathlib.Path(templates_location).rglob("*"))=}', file=sys.stderr)
from VS_template import VS_Template

img = self.plot(VS_Template(driver=self.vsec))
Expand Down
9 changes: 8 additions & 1 deletion tests/_test_mswms/test_wms.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
import sys
import time
import os
from shutil import move
Expand Down Expand Up @@ -413,9 +414,9 @@ def do_test():
# how we use qtbot.wait_until in other places.
time.sleep(10)
result2 = self.client.get('/?{}'.format(environ["QUERY_STRING"]))
assert result.data != result2.data
nco.ncap2(input=os.path.join(DATA_DIR, pl_file), output=os.path.join(DATA_DIR, pl_file),
options=["-s \"geopotential_height/=2\""])
assert result.data != result2.data

# Assert moved file was reloaded and now looks like the first image
move(os.path.join(DATA_DIR, pl_file), os.path.join(DATA_DIR, pl_file + "2"))
Expand All @@ -434,6 +435,12 @@ def do_test():
"data_access", new=watch_access):
do_test()

@pytest.mark.skipif(
sys.platform == "darwin",
reason="Changes global variables (e.g. DOCS_LOCATION) which can affect other tests depending on test order"
" (e.g. tests/_test_mswms/test_mss_plot_driver.py::Test_VSec::test_VS_gallery_template fails consistently in"
" reverse order on MacOS 14).",
)
def test_gallery(self, tmpdir):
tempdir = tmpdir.mkdir("static")
docsdir = tmpdir.mkdir("docs")
Expand Down

0 comments on commit 2c3a674

Please sign in to comment.