Skip to content

Commit f03d4d3

Browse files
authored
Fix visdom tests for macos-latest (#2253)
* Fix shell * Setup shell via job defaults * Revert "Skipping visdom tests on macosx (#2247)" This reverts commit 322b049.
1 parent 322b049 commit f03d4d3

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-25
lines changed

.github/workflows/unit-tests.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
jobs:
2222
build:
2323
runs-on: ${{ matrix.os }}
24+
defaults:
25+
run:
26+
shell: bash
2427
strategy:
2528
max-parallel: 10
2629
fail-fast: false
@@ -50,7 +53,6 @@ jobs:
5053
id: get-date
5154
run: |
5255
echo "::set-output name=date::$(/bin/date "+%Y-%U")"
53-
shell: bash -l {0}
5456
5557
- name: Get pip cache dir
5658
id: pip-cache
@@ -100,12 +102,10 @@ jobs:
100102

101103
# Copy MNIST to "." for the examples
102104
- name: Copy MNIST
103-
shell: bash -l {0}
104105
run: |
105106
cp -R /tmp/MNIST .
106107
107108
- name: Run Tests
108-
shell: bash -l {0}
109109
run: |
110110
SKIP_DISTRIB_TESTS=${{ matrix.skip-distrib-tests }} bash tests/run_cpu_tests.sh
111111
@@ -117,14 +117,12 @@ jobs:
117117
fail_ci_if_error: false
118118

119119
- name: Run MNIST Examples
120-
shell: bash -l {0}
121120
run: |
122121
# MNIST
123122
# 1) mnist.py
124123
python examples/mnist/mnist.py --epochs=1
125124
126125
- name: Run MNIST with loggers Examples
127-
shell: bash -l {0}
128126
if: ${{ matrix.os == 'ubuntu-latest' }}
129127
run: |
130128
# 2) mnist_with_visdom.py
@@ -140,28 +138,24 @@ jobs:
140138
python examples/mnist/mnist_with_tensorboard.py --epochs=1
141139
142140
- name: Run MNIST Example With Crash
143-
shell: bash -l {0}
144141
if: ${{ matrix.os == 'ubuntu-latest' }}
145142
continue-on-error: true
146143
run: |
147144
# 4) mnist_save_resume_engine.py
148145
python examples/mnist/mnist_save_resume_engine.py --epochs=2 --crash_iteration 1100
149146
150147
- name: Resume MNIST from previous crash
151-
shell: bash -l {0}
152148
if: ${{ matrix.os == 'ubuntu-latest' }}
153149
run: |
154150
python examples/mnist/mnist_save_resume_engine.py --epochs=2 --resume_from=/tmp/mnist_save_resume/checkpoint_1.pt
155151
156152
- name: Run GAN example
157-
shell: bash -l {0}
158153
if: ${{ matrix.os == 'ubuntu-latest' }}
159154
run: |
160155
# DCGAN
161156
python examples/gan/dcgan.py --dataset fake --dataroot /tmp/fakedata --output-dir /tmp/outputs-dcgan --batch-size 2 --epochs 2 --workers 0
162157
163158
- name: Run RL Examples
164-
shell: bash -l {0}
165159
if: ${{ matrix.os == 'ubuntu-latest' }}
166160
run: |
167161
# RL
@@ -171,7 +165,6 @@ jobs:
171165
python examples/reinforcement_learning/reinforce.py --max-episodes=2
172166
173167
- name: Run Neural Style Example
174-
shell: bash -l {0}
175168
if: ${{ matrix.os == 'ubuntu-latest' }}
176169
run: |
177170
#fast-neural-style

tests/ignite/contrib/handlers/test_visdom_logger.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -870,19 +870,15 @@ def test_integration_no_server():
870870
VisdomLogger()
871871

872872

873-
@pytest.mark.skipif(
874-
sys.platform.startswith("win") or sys.platform.startswith("darwin"), reason="Skip on Windows and Macosx"
875-
)
873+
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Skip on Windows")
876874
def test_logger_init_hostname_port(visdom_server):
877875
# Explicit hostname, port
878876
vd_logger = VisdomLogger(server=visdom_server[0], port=visdom_server[1], num_workers=0)
879877
assert "main" in vd_logger.vis.get_env_list()
880878
vd_logger.close()
881879

882880

883-
@pytest.mark.skipif(
884-
sys.platform.startswith("win") or sys.platform.startswith("darwin"), reason="Skip on Windows and Macosx"
885-
)
881+
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Skip on Windows")
886882
def test_logger_init_env_vars(visdom_server):
887883
# As env vars
888884
import os
@@ -900,9 +896,7 @@ def _parse_content(content):
900896
return json.loads(content)
901897

902898

903-
@pytest.mark.skipif(
904-
sys.platform.startswith("win") or sys.platform.startswith("darwin"), reason="Skip on Windows and Macosx"
905-
)
899+
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Skip on Windows")
906900
def test_integration_no_executor(visdom_server):
907901
vd_logger = VisdomLogger(server=visdom_server[0], port=visdom_server[1], num_workers=0)
908902

@@ -938,9 +932,7 @@ def update_fn(engine, batch):
938932
vd_logger.close()
939933

940934

941-
@pytest.mark.skipif(
942-
sys.platform.startswith("win") or sys.platform.startswith("darwin"), reason="Skip on Windows and Macosx"
943-
)
935+
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Skip on Windows")
944936
def test_integration_with_executor(visdom_server):
945937
vd_logger = VisdomLogger(server=visdom_server[0], port=visdom_server[1], num_workers=1)
946938

@@ -977,9 +969,7 @@ def update_fn(engine, batch):
977969
vd_logger.close()
978970

979971

980-
@pytest.mark.skipif(
981-
sys.platform.startswith("win") or sys.platform.startswith("darwin"), reason="Skip on Windows and Macosx"
982-
)
972+
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Skip on Windows")
983973
def test_integration_with_executor_as_context_manager(visdom_server, visdom_server_stop):
984974

985975
n_epochs = 5

0 commit comments

Comments
 (0)