From 008b4a31ebd169186329031e0fec4dab52703ff6 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 15 Sep 2016 08:29:18 +0200 Subject: [PATCH] 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. --- tests/import.TestCase | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/import.TestCase b/tests/import.TestCase index 4d5acc56..7b846a5f 100755 --- a/tests/import.TestCase +++ b/tests/import.TestCase @@ -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)