@@ -547,41 +547,61 @@ jobs:
547
547
# The "sanity" tests run on each pull request to test that a subset of the
548
548
# full tests work with the slower engines (ray, dask, and unidist-MPI).
549
549
needs : [lint-flake8, execution-filter, python-filter]
550
- if : github.event_name == 'pull_request'
550
+ # If we don't need to run any sanity tests, the job matrix that we generate
551
+ # here gives a single job with all the matrix fields empty (that is, os,
552
+ # execution, etc. are not set, so we treat them as "").
553
+ # so, if the matrix is going to be empty, we need to skip this job
554
+ # completely. This bizarre behavior is not in the official documentation,
555
+ # of GitHub actions matrices, but someone does mention it here:
556
+ # https://stackoverflow.com/a/77118991
557
+ if : |
558
+ github.event_name == 'pull_request' &&
559
+ (
560
+ needs.execution-filter.outputs.ray != 'true' ||
561
+ needs.execution-filter.outputs.dask != 'true' ||
562
+ needs.execution-filter.outputs.unidist != 'true'
563
+ )
551
564
strategy :
552
565
matrix :
553
566
os :
554
567
- ubuntu
555
568
- windows
556
569
python-version : [ "${{ needs.python-filter.outputs.python-version }}" ]
557
- execution :
558
- - name : ray
559
- shell-ex : " python -m pytest"
560
- # If we're going to run all ray tests because we've detected a
561
- # change to the ray engine, we don't need to run these sanity tests
562
- # on ray.
563
- if : needs.execution-filter.outputs.ray != 'true'
564
- - name : dask
565
- shell-ex : " python -m pytest"
566
- # If we're going to run all dask tests because we've detected a
567
- # change to the dask engine, we don't need to run these sanity tests
568
- # on dask.
569
- if : needs.execution-filter.outputs.dask != 'true'
570
- - name : unidist
571
- shell-ex : " mpiexec -n 1 -genv AWS_ACCESS_KEY_ID foobar_key -genv AWS_SECRET_ACCESS_KEY foobar_secret python -m pytest"
572
- # If we're going to run all unidist tests because we've detected a
573
- # change to the unidist engine, we don't need to run these sanity tests
574
- # on unidist.
575
- if : needs.execution-filter.outputs.unidist != 'true'
570
+ running-all-ray-tests : [ "${{ needs.execution-filter.outputs.ray }}" ]
571
+ running-all-dask-tests : [ "${{needs.execution-filter.outputs.dask}}" ]
572
+ running-all-unidist-tests : [ "${{needs.execution-filter.outputs.unidist}}" ]
573
+ execution : [ray, dask, unidist]
574
+ # If we're going to run all ray tests because we've detected a
575
+ # change to the ray engine, we don't need to run these sanity tests
576
+ # on ray. Likewise for dask and unidist.
577
+ exclude :
578
+ - running-all-ray-tests : ' true'
579
+ execution : ray
580
+ - running-all-dask-tests : ' true'
581
+ execution : dask
582
+ - running-all-unidist-tests : ' true'
583
+ execution : unidist
576
584
runs-on : ${{ matrix.os }}-latest
577
585
defaults :
578
586
run :
579
587
shell : bash -l {0}
580
588
env :
581
- MODIN_ENGINE : ${{ matrix.execution.name }}
589
+ MODIN_ENGINE : ${{ matrix.execution }}
582
590
UNIDIST_BACKEND : " mpi"
583
- PARALLEL : ${{ matrix.execution.name != 'unidist' && matrix.os != 'windows' && '-n 2' || '' }}
584
- name : test-${{ matrix.os }}-sanity (engine ${{ matrix.execution.name }}, python ${{matrix.python-version}})
591
+ PARALLEL : ${{ matrix.execution != 'unidist' && matrix.os != 'windows' && '-n 2' || '' }}
592
+ PYTEST_COMMAND : >-
593
+ ${{
594
+ (
595
+ (matrix.execution == 'ray' || matrix.execution == 'dask') &&
596
+ 'python -m pytest'
597
+ ) ||
598
+ (
599
+ matrix.execution == 'unidist' &&
600
+ 'mpiexec -n 1 -genv AWS_ACCESS_KEY_ID foobar_key -genv AWS_SECRET_ACCESS_KEY foobar_secret python -m pytest'
601
+ ) ||
602
+ 'UNKNOWN_PYTEST_COMMAND'
603
+ }}
604
+ name : test-${{ matrix.os }}-sanity (engine ${{ matrix.execution }}, python ${{matrix.python-version}})
585
605
services :
586
606
moto :
587
607
image : ${{ matrix.os != 'windows' && 'motoserver/moto:5.0.13' || '' }}
@@ -594,18 +614,18 @@ jobs:
594
614
- uses : actions/checkout@v4
595
615
- uses : ./.github/actions/mamba-env
596
616
with :
597
- environment-file : ${{ matrix.os == 'ubuntu' && matrix.execution.name == 'unidist' && 'requirements/env_unidist_linux.yml' || matrix.os == 'windows' && matrix.execution.name == 'unidist' && 'requirements/env_unidist_win.yml' || 'environment-dev.yml' }}
598
- activate-environment : ${{ matrix.execution.name == 'unidist' && 'modin_on_unidist' || 'modin' }}
617
+ environment-file : ${{ matrix.os == 'ubuntu' && matrix.execution == 'unidist' && 'requirements/env_unidist_linux.yml' || matrix.os == 'windows' && matrix.execution == 'unidist' && 'requirements/env_unidist_win.yml' || 'environment-dev.yml' }}
618
+ activate-environment : ${{ matrix.execution == 'unidist' && 'modin_on_unidist' || 'modin' }}
599
619
python-version : ${{matrix.python-version}}
600
620
- name : Install HDF5
601
621
run : sudo apt update && sudo apt install -y libhdf5-dev
602
622
if : matrix.os != 'windows'
603
623
- name : Limit ray memory
604
624
run : echo "MODIN_MEMORY=1000000000" >> $GITHUB_ENV
605
- if : matrix.os != 'windows' && matrix.execution.name == 'ray'
625
+ if : matrix.os != 'windows' && matrix.execution == 'ray'
606
626
- name : Tell Modin to use existing ray cluster
607
627
run : echo "MODIN_RAY_CLUSTER=True" >> $GITHUB_ENV
608
- if : matrix.os == 'windows' && matrix.execution.name == 'ray'
628
+ if : matrix.os == 'windows' && matrix.execution == 'ray'
609
629
- name : Start local ray cluster
610
630
# Try a few times to start ray to work around
611
631
# https://github.com/modin-project/modin/issues/4562
@@ -614,71 +634,71 @@ jobs:
614
634
timeout_minutes : 5
615
635
max_attempts : 5
616
636
command : ray start --head --port=6379 --object-store-memory=1000000000
617
- if : matrix.os == 'windows' && matrix.execution.name == 'ray'
618
- - run : MODIN_BENCHMARK_MODE=True ${{ matrix.execution.shell-ex }} modin/tests/pandas/internals/test_benchmark_mode.py
619
- - run : ${{ matrix.execution.shell-ex }} $PARALLEL modin/tests/test_partition_api.py
620
- - run : ${{ matrix.execution.shell-ex }} modin/tests/pandas/extensions
637
+ if : matrix.os == 'windows' && matrix.execution == 'ray'
638
+ - run : MODIN_BENCHMARK_MODE=True $PYTEST_COMMAND modin/tests/pandas/internals/test_benchmark_mode.py
639
+ - run : $PYTEST_COMMAND $PARALLEL modin/tests/test_partition_api.py
640
+ - run : $PYTEST_COMMAND modin/tests/pandas/extensions
621
641
- name : xgboost tests
622
642
run : |
623
643
# TODO(https://github.com/modin-project/modin/issues/5194): Uncap xgboost
624
644
# when we use collective instead of rabit.
625
645
mamba install "xgboost>=1.7.1,<2.0.0" scikit-learn -c conda-forge
626
- ${{ matrix.execution.shell-ex }} $PARALLEL \
646
+ $PYTEST_COMMAND $PARALLEL \
627
647
modin/tests/experimental/xgboost/test_default.py \
628
648
modin/tests/experimental/xgboost/test_xgboost.py \
629
649
modin/tests/experimental/xgboost/test_dmatrix.py
630
650
if : matrix.os != 'windows' && needs.execution-filter.outputs.experimental == 'true'
631
- - run : ${{ matrix.execution.shell-ex }} $PARALLEL modin/tests/experimental/test_pipeline.py
632
- if : matrix.os != 'windows' && matrix.execution.name != 'unidist' && needs.execution-filter.outputs.experimental == 'true'
651
+ - run : $PYTEST_COMMAND $PARALLEL modin/tests/experimental/test_pipeline.py
652
+ if : matrix.os != 'windows' && matrix.execution != 'unidist' && needs.execution-filter.outputs.experimental == 'true'
633
653
- name : " test DF: binary, default, iter"
634
654
run : |
635
- ${{ matrix.execution.shell-ex }} $PARALLEL \
655
+ $PYTEST_COMMAND $PARALLEL \
636
656
modin/tests/pandas/dataframe/test_binary.py \
637
657
modin/tests/pandas/dataframe/test_default.py \
638
658
modin/tests/pandas/dataframe/test_iter.py
639
659
if : matrix.os != 'windows'
640
660
- name : " test DF: reduce, udf, window, pickle"
641
661
run : |
642
- ${{ matrix.execution.shell-ex }} $PARALLEL \
662
+ $PYTEST_COMMAND $PARALLEL \
643
663
modin/tests/pandas/dataframe/test_reduce.py \
644
664
modin/tests/pandas/dataframe/test_udf.py \
645
665
modin/tests/pandas/dataframe/test_window.py \
646
666
modin/tests/pandas/dataframe/test_pickle.py
647
667
if : matrix.os != 'windows'
648
- - run : ${{ matrix.execution.shell-ex }} modin/tests/pandas/test_series.py
649
- if : matrix.execution.name == 'ray'
650
- - run : ${{ matrix.execution.shell-ex }} -m "not exclude_in_sanity" modin/tests/pandas/test_series.py
651
- if : matrix.execution.name != 'ray'
652
- - run : ${{ matrix.execution.shell-ex }} modin/tests/pandas/dataframe/test_map_metadata.py
653
- if : matrix.execution.name == 'ray'
654
- - run : ${{ matrix.execution.shell-ex }} -m "not exclude_in_sanity" modin/tests/pandas/dataframe/test_map_metadata.py
655
- if : matrix.execution.name != 'ray'
668
+ - run : $PYTEST_COMMAND modin/tests/pandas/test_series.py
669
+ if : matrix.execution == 'ray'
670
+ - run : $PYTEST_COMMAND -m "not exclude_in_sanity" modin/tests/pandas/test_series.py
671
+ if : matrix.execution != 'ray'
672
+ - run : $PYTEST_COMMAND modin/tests/pandas/dataframe/test_map_metadata.py
673
+ if : matrix.execution == 'ray'
674
+ - run : $PYTEST_COMMAND -m "not exclude_in_sanity" modin/tests/pandas/dataframe/test_map_metadata.py
675
+ if : matrix.execution != 'ray'
656
676
- name : " test rolling, expanding, reshape, general, concat"
657
677
run : |
658
- ${{ matrix.execution.shell-ex }} $PARALLEL \
678
+ $PYTEST_COMMAND $PARALLEL \
659
679
modin/tests/pandas/test_rolling.py \
660
680
modin/tests/pandas/test_expanding.py \
661
681
modin/tests/pandas/test_reshape.py \
662
682
modin/tests/pandas/test_general.py \
663
683
modin/tests/pandas/test_concat.py
664
684
if : matrix.os != 'windows'
665
- - run : ${{ matrix.execution.shell-ex }} $PARALLEL modin/tests/numpy
666
- - run : ${{ matrix.execution.shell-ex }} -m "not exclude_in_sanity" modin/tests/pandas/test_io.py --verbose
667
- if : matrix.execution.name != 'unidist'
685
+ - run : $PYTEST_COMMAND $PARALLEL modin/tests/numpy
686
+ - run : $PYTEST_COMMAND -m "not exclude_in_sanity" modin/tests/pandas/test_io.py --verbose
687
+ if : matrix.execution != 'unidist'
668
688
- uses : nick-fields/retry@v3
669
689
# to avoid issues with non-stable `to_csv` tests for unidist on MPI backend.
670
690
# for details see: https://github.com/modin-project/modin/pull/6776
671
691
with :
672
692
timeout_minutes : 15
673
693
max_attempts : 3
674
- command : conda run --no-capture-output -n modin_on_unidist ${{ matrix.execution.shell-ex }} -m "not exclude_in_sanity" modin/tests/pandas/test_io.py --verbose
675
- if : matrix.execution.name == 'unidist'
676
- - run : ${{ matrix.execution.shell-ex }} modin/tests/experimental/test_io_exp.py
677
- - run : ${{ matrix.execution.shell-ex }} $PARALLEL modin/tests/interchange/dataframe_protocol/test_general.py
678
- - run : ${{ matrix.execution.shell-ex }} $PARALLEL modin/tests/interchange/dataframe_protocol/pandas/test_protocol.py
694
+ command : conda run --no-capture-output -n modin_on_unidist $PYTEST_COMMAND -m "not exclude_in_sanity" modin/tests/pandas/test_io.py --verbose
695
+ if : matrix.execution == 'unidist'
696
+ - run : $PYTEST_COMMAND modin/tests/experimental/test_io_exp.py
697
+ - run : $PYTEST_COMMAND $PARALLEL modin/tests/interchange/dataframe_protocol/test_general.py
698
+ - run : $PYTEST_COMMAND $PARALLEL modin/tests/interchange/dataframe_protocol/pandas/test_protocol.py
679
699
- name : Stop local ray cluster
680
700
run : ray stop
681
- if : matrix.os == 'windows' && matrix.execution.name == 'ray'
701
+ if : matrix.os == 'windows' && matrix.execution == 'ray'
682
702
- uses : ./.github/actions/upload-coverage
683
703
684
704
test-experimental :
0 commit comments