From d5675b7526e22c76f601cbc5e32cb72f03439d27 Mon Sep 17 00:00:00 2001
From: Massimiliano Pippi <mpippi@gmail.com>
Date: Wed, 24 Jul 2019 17:38:31 +0200
Subject: [PATCH 1/2] skip tests we cannot run on Drone

---
 .drone.yml        | 1 -
 test/test_main.py | 8 ++++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/.drone.yml b/.drone.yml
index 9c7df4ebe1c..cff5f148797 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -23,7 +23,6 @@ steps:
 
 - name: integration
   image: arduino/arduino-cli:drone-1.0
-  failure: ignore  # work in progress, we know some tests will fail at the moment
   commands:
     - pip install -r test/requirements.txt
     - task test-integration
diff --git a/test/test_main.py b/test/test_main.py
index 228a5071514..27e69259a3f 100644
--- a/test/test_main.py
+++ b/test/test_main.py
@@ -6,6 +6,10 @@
 from datetime import datetime
 
 
+def running_on_ci():
+    return os.getenv('APPVEYOR') or os.getenv('DRONE')
+
+
 def test_command_help(run_command):
     result = run_command('help')
     assert result.ok
@@ -62,7 +66,7 @@ def test_command_lib_search(run_command):
     assert number_of_libs == number_of_libs_from_json
 
 
-@pytest.mark.skipif(os.getenv('APPVEYOR'), reason="Appveyor VMs have no serial ports")
+@pytest.mark.skipif(running_on_ci(), reason="VMs have no serial ports")
 def test_command_board_list(run_command):
     result = run_command('core update-index')
     assert result.ok
@@ -76,7 +80,7 @@ def test_command_board_list(run_command):
         assert 'protocol_label' in port
 
 
-@pytest.mark.skipif(os.getenv('APPVEYOR'), reason="Appveyor VMs have no serial ports")
+@pytest.mark.skipif(running_on_ci(), reason="VMs have no serial ports")
 def test_command_board_listall(run_command):
     result = run_command('board listall')
     assert result.ok

From ca8e25b0248d4febc9806b187cdccd5b150b0b86 Mon Sep 17 00:00:00 2001
From: Massimiliano Pippi <mpippi@gmail.com>
Date: Wed, 24 Jul 2019 17:53:07 +0200
Subject: [PATCH 2/2] convert to bool before returning

---
 test/test_main.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/test_main.py b/test/test_main.py
index 27e69259a3f..66b165d041c 100644
--- a/test/test_main.py
+++ b/test/test_main.py
@@ -7,7 +7,8 @@
 
 
 def running_on_ci():
-    return os.getenv('APPVEYOR') or os.getenv('DRONE')
+    val = os.getenv('APPVEYOR') or os.getenv('DRONE')
+    return val is not None
 
 
 def test_command_help(run_command):