Skip to content

Commit 8292709

Browse files
authored
Skip tests we cannot run on Drone (#309)
* skip tests we cannot run on Drone * convert to bool before returning
1 parent 38e831c commit 8292709

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Diff for: .drone.yml

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ steps:
2323

2424
- name: integration
2525
image: arduino/arduino-cli:drone-1.0
26-
failure: ignore # work in progress, we know some tests will fail at the moment
2726
commands:
2827
- pip install -r test/requirements.txt
2928
- task test-integration

Diff for: test/test_main.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
from datetime import datetime
77

88

9+
def running_on_ci():
10+
val = os.getenv('APPVEYOR') or os.getenv('DRONE')
11+
return val is not None
12+
13+
914
def test_command_help(run_command):
1015
result = run_command('help')
1116
assert result.ok
@@ -62,7 +67,7 @@ def test_command_lib_search(run_command):
6267
assert number_of_libs == number_of_libs_from_json
6368

6469

65-
@pytest.mark.skipif(os.getenv('APPVEYOR'), reason="Appveyor VMs have no serial ports")
70+
@pytest.mark.skipif(running_on_ci(), reason="VMs have no serial ports")
6671
def test_command_board_list(run_command):
6772
result = run_command('core update-index')
6873
assert result.ok
@@ -76,7 +81,7 @@ def test_command_board_list(run_command):
7681
assert 'protocol_label' in port
7782

7883

79-
@pytest.mark.skipif(os.getenv('APPVEYOR'), reason="Appveyor VMs have no serial ports")
84+
@pytest.mark.skipif(running_on_ci(), reason="VMs have no serial ports")
8085
def test_command_board_listall(run_command):
8186
result = run_command('board listall')
8287
assert result.ok

0 commit comments

Comments
 (0)