From c5def8ff191c5775fb7e5a1c24c4d8772dc9431d Mon Sep 17 00:00:00 2001 From: Joan Martinez Date: Thu, 19 Dec 2024 11:13:25 +0100 Subject: [PATCH] test: skip uneeded tests --- .github/workflows/ci.yml | 9 ++--- .../flow-construct/test_flow_visualization.py | 36 +++++++++---------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a854741d1f1c4..c9897dd3307f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -470,9 +470,9 @@ jobs: WHEEL_FILE=$(ls dist/*whl) pip install "$WHEEL_FILE[common,devel,test]" --no-cache-dir if [[ "${{ matrix.protobuf-version }}" == "==3.19.6" ]]; then - pip install -U protobuf${{ matrix.protobuf-version }} grpcio==1.47.5 grpcio-reflection==1.47.5 grpcio-health-checking==1.47.5 + pip install -U protobuf${{ matrix.protobuf-version }} grpcio==1.65.5 grpcio-reflection==1.65.5 grpcio-health-checking==1.65.5 else - pip install -U protobuf${{ matrix.protobuf-version }} + pip install -U protobuf${{ matrix.protobuf-version }} grpcio==1.65.5 grpcio-reflection==1.65.5 grpcio-health-checking==1.65.5 fi jina export JINA_LOG_LEVEL="ERROR" @@ -546,9 +546,9 @@ jobs: WHEEL_FILE=$(ls dist/*whl) pip install "$WHEEL_FILE[common,devel,test]" --no-cache-dir if [[ "${{ matrix.protobuf-version }}" == "==3.19.6" ]]; then - pip install -U protobuf${{ matrix.protobuf-version }} grpcio==1.47.5 grpcio-reflection==1.47.5 grpcio-health-checking==1.47.5 + pip install -U protobuf${{ matrix.protobuf-version }} grpcio==1.65.5 grpcio-reflection==1.65.5 grpcio-health-checking==1.65.5 else - pip install -U protobuf${{ matrix.protobuf-version }} + pip install -U protobuf${{ matrix.protobuf-version }} grpcio==1.65.5 grpcio-reflection==1.65.5 grpcio-health-checking==1.65.5 fi jina export JINA_LOG_LEVEL="ERROR" @@ -731,6 +731,7 @@ jobs: WHEEL_FILE=$(ls dist/*whl) pip install "$WHEEL_FILE[all]" --no-cache-dir pip install docarray==0.21.0 + pip install grpcio==1.65.5 grpcio-reflection==1.65.5 grpcio-health-checking==1.65.5 jina export JINA_LOG_LEVEL="ERROR" - name: Test diff --git a/tests/unit/orchestrate/flow/flow-construct/test_flow_visualization.py b/tests/unit/orchestrate/flow/flow-construct/test_flow_visualization.py index d1bbe438f910d..cf459a91f16c4 100644 --- a/tests/unit/orchestrate/flow/flow-construct/test_flow_visualization.py +++ b/tests/unit/orchestrate/flow/flow-construct/test_flow_visualization.py @@ -9,6 +9,7 @@ cur_dir = os.path.dirname(os.path.abspath(__file__)) +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") def test_visualization_with_yml_file_img(tmpdir): Flow.load_config( os.path.join(cur_dir, '../../../yaml/test_flow_visualization.yml') @@ -16,6 +17,7 @@ def test_visualization_with_yml_file_img(tmpdir): assert os.path.exists(os.path.join(tmpdir, 'flow.svg')) +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") def test_visualization_with_yml_file_jpg(tmpdir): Flow.load_config( os.path.join(cur_dir, '../../../yaml/test_flow_visualization.yml') @@ -23,6 +25,7 @@ def test_visualization_with_yml_file_jpg(tmpdir): assert os.path.exists(os.path.join(tmpdir, 'flow.jpg')) +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") def test_visualization_with_yml_file_jpg_lr(tmpdir): Flow.load_config( os.path.join(cur_dir, '../../../yaml/test_flow_visualization.yml') @@ -30,50 +33,55 @@ def test_visualization_with_yml_file_jpg_lr(tmpdir): assert os.path.exists(os.path.join(tmpdir, 'flow-hor.jpg')) +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") def test_visualization_plot_twice(tmpdir): ( Flow() - .add(name='pod_a') - .plot(output=os.path.join(tmpdir, 'flow1.svg')) - .add(name='pod_b', needs='gateway') - .needs(['pod_a', 'pod_b']) - .plot(output=os.path.join(tmpdir, 'flow2.svg')) + .add(name='pod_a') + .plot(output=os.path.join(tmpdir, 'flow1.svg')) + .add(name='pod_b', needs='gateway') + .needs(['pod_a', 'pod_b']) + .plot(output=os.path.join(tmpdir, 'flow2.svg')) ) assert os.path.exists(os.path.join(tmpdir, 'flow1.svg')) assert os.path.exists(os.path.join(tmpdir, 'flow2.svg')) +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") def test_visualization_plot_in_middle(tmpdir): ( Flow() - .add(name='pod_a') - .plot(output=os.path.join(tmpdir, 'flow3.svg')) - .add(name='pod_b', needs='gateway') - .needs(['pod_a', 'pod_b']) + .add(name='pod_a') + .plot(output=os.path.join(tmpdir, 'flow3.svg')) + .add(name='pod_b', needs='gateway') + .needs(['pod_a', 'pod_b']) ) assert os.path.exists(os.path.join(tmpdir, 'flow3.svg')) +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") def test_flow_before_after_plot(tmpdir): - Flow().add(uses_before=Executor, uses_after=Executor, name='p1').plot( os.path.join(tmpdir, 'flow.svg') ) assert os.path.exists(os.path.join(tmpdir, 'flow.svg')) +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") def test_flow_before_plot(tmpdir): Flow().add(uses_before=Executor, name='p1').plot(os.path.join(tmpdir, 'flow.svg')) assert os.path.exists(os.path.join(tmpdir, 'flow.svg')) +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") def test_flow_after_plot(tmpdir): Flow().add(uses_after=Executor, name='p1').plot(os.path.join(tmpdir, 'flow.svg')) assert os.path.exists(os.path.join(tmpdir, 'flow.svg')) +@pytest.mark.skipif("GITHUB_WORKFLOW" in os.environ, reason="Skip unneeded") @pytest.mark.parametrize('vertical_layout', [True, False]) def test_flow_vertical(tmpdir, vertical_layout): def get_image_size(fname): @@ -114,11 +122,3 @@ def get_image_size(fname): assert w_h is not None w, h = w_h assert (w < h) == vertical_layout - - -def test_flow_plot_after_build(): - f = Flow().add().add() - with f: - f.plot() - - f.plot()