From 2c3a674968148b355658b06191ba98004dc420e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Ri=C3=9Fe?= Date: Mon, 26 Feb 2024 18:11:47 +0100 Subject: [PATCH] TEMP --- .github/workflows/testing-all-oses.yml | 21 ++++++++++++--------- tests/_test_mswms/test_mss_plot_driver.py | 3 +++ tests/_test_mswms/test_wms.py | 9 ++++++++- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/testing-all-oses.yml b/.github/workflows/testing-all-oses.yml index 139068a0a..336526565 100644 --- a/.github/workflows/testing-all-oses.yml +++ b/.github/workflows/testing-all-oses.yml @@ -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: @@ -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: diff --git a/tests/_test_mswms/test_mss_plot_driver.py b/tests/_test_mswms/test_mss_plot_driver.py index b4c0143ef..60623702d 100644 --- a/tests/_test_mswms/test_mss_plot_driver.py +++ b/tests/_test_mswms/test_mss_plot_driver.py @@ -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)) diff --git a/tests/_test_mswms/test_wms.py b/tests/_test_mswms/test_wms.py index 85b3dcb9a..9f1b61bfa 100644 --- a/tests/_test_mswms/test_wms.py +++ b/tests/_test_mswms/test_wms.py @@ -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 @@ -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")) @@ -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")