chiark / gitweb /
skip `fdroid import` test if gitlab is not available
authorHans-Christoph Steiner <hans@eds.org>
Thu, 15 Sep 2016 06:29:18 +0000 (08:29 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Thu, 15 Sep 2016 21:20:18 +0000 (23:20 +0200)
This prevents CI build failures when gitlab is deploying or has other
issues that might cause a 500.

tests/import.TestCase

index 4d5acc56520a8a95f7010d61571cec574f64c67d..7b846a5fd929859a98ed3bb0cea19a0049eb762a 100755 (executable)
@@ -5,6 +5,7 @@
 import inspect
 import optparse
 import os
+import requests
 import sys
 import unittest
 
@@ -30,6 +31,12 @@ class ImportTest(unittest.TestCase):
         fdroidserver.common.config = config
 
         url = 'https://gitlab.com/fdroid/fdroidclient'
+        r = requests.head(url)
+        if r.status_code != 200:
+            print("ERROR", url, 'unreachable (', r.status_code, ')')
+            print('Skipping ImportTest!')
+            return
+
         app = fdroidserver.metadata.get_default_app_info()
         app.UpdateCheckMode = "Tags"
         root_dir, src_dir = import_proxy.get_metadata_from_url(app, url)