skip `fdroid import` test if gitlab is not available

This prevents CI build failures when gitlab is deploying or has other
issues that might cause a 500.
This commit is contained in:
Hans-Christoph Steiner 2016-09-15 08:29:18 +02:00
parent 89010a1ba5
commit 008b4a31eb
1 changed files with 7 additions and 0 deletions

View File

@ -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)