Skip to content

Commit

Permalink
Run the test suite in a random order
Browse files Browse the repository at this point in the history
  • Loading branch information
matrss committed Mar 21, 2024
1 parent a360358 commit 33c548d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/testing-all-oses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
fail-fast: false
matrix:
os: ["macos-13", "macos-14", "ubuntu-latest"]
order: ["normal", "reverse"]
steps:
- uses: actions/checkout@v4
- name: Build requirements.txt file
Expand All @@ -29,6 +28,7 @@ jobs:
sed -e "s/menuinst.*//" |
sed -e "s/.*://" > requirements.tmp.txt
cat requirements.d/development.txt >> requirements.tmp.txt
echo "pytest-randomly" >> requirements.tmp.txt
sed -e '/^$/d' -e '/^#.*$/d' requirements.tmp.txt > requirements.txt
rm requirements.tmp.txt
cat requirements.txt
Expand All @@ -50,4 +50,4 @@ jobs:
# TODO: fix those tests and drop the ignores
run: micromamba run -n ci env QT_QPA_PLATFORM=offscreen pytest -v -n logical --durations=20 --cov=mslib
--ignore=tests/_test_msui/test_sideview.py --ignore=tests/_test_msui/test_topview.py --ignore=tests/_test_msui/test_wms_control.py
${{ (matrix.order == 'normal' && ' ') || (matrix.order == 'reverse' && '--reverse') }} tests
tests
11 changes: 4 additions & 7 deletions tests/_test_mswms/test_wms.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
import sys
import os
from shutil import move

Expand Down Expand Up @@ -388,11 +387,11 @@ def test_import_error(self):
assert mslib.mswms.wms.mswms_settings.__file__ is not None
assert mslib.mswms.wms.mswms_auth.__file__ is not None

@pytest.mark.skipif(
sys.platform == "darwin",
reason="""\
@pytest.mark.skip("""\
There is a race condition between modifying with ncap2 and asserting that the file changed where the server might not
see the change before the request is made, which leads to a failure of the following assert.
This test fails on macOS 14 and can also fail on Linux when the pytest test order is randomized.
""".strip(),
)
def test_files_changed(self):
Expand Down Expand Up @@ -436,9 +435,7 @@ def do_test():
"data_access", new=watch_access):
do_test()

@pytest.mark.skipif(
sys.platform == "darwin",
reason="""\
@pytest.mark.skip("""\
This test 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).
Expand Down

0 comments on commit 33c548d

Please sign in to comment.