From 3c3cdcb20081e80d1680c157c57b176eb71dcf57 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 10 Jul 2014 12:32:02 -0600 Subject: [PATCH] Don't execute network-using tests by default Set TEST_ONLINE to use them. Signed-off-by: Zack Cerza --- teuthology/test/test_suite.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/teuthology/test/test_suite.py b/teuthology/test/test_suite.py index abf8edbc12..0a9fb5e08e 100644 --- a/teuthology/test/test_suite.py +++ b/teuthology/test/test_suite.py @@ -1,12 +1,13 @@ +import os import requests from datetime import datetime -from pytest import raises +from pytest import raises, skip from teuthology.config import config from teuthology import suite -class TestSuite(object): +class TestSuiteOffline(object): def test_name_timestamp_passed(self): stamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S') name = suite.make_run_name('suite', 'ceph', 'kernel', 'flavor', @@ -24,12 +25,6 @@ class TestSuite(object): 'mtype', user='USER') assert name.startswith('USER-') - def test_ceph_hash(self): - resp = requests.get( - 'https://api.github.com/repos/ceph/ceph/git/refs/heads/master') - ref_hash = resp.json()['object']['sha'] - assert suite.get_hash('ceph') == ref_hash - def test_distro_defaults_saya(self): assert suite.get_distro_defaults('ubuntu', 'saya') == ('armv7l', 'saucy', 'deb') @@ -44,6 +39,18 @@ class TestSuite(object): assert suite.get_gitbuilder_url('ceph', 'squeeze', 'deb', 'x86_64', 'basic') == ref_url + +class TestSuiteOnline(object): + def setup(self): + if 'TEST_ONLINE' not in os.environ: + skip("To run these sets, set the environment variable TEST_ONLINE") + + def test_ceph_hash(self): + resp = requests.get( + 'https://api.github.com/repos/ceph/ceph/git/refs/heads/master') + ref_hash = resp.json()['object']['sha'] + assert suite.get_hash('ceph') == ref_hash + def test_config_bogus_kernel_branch(self): # Don't attempt to send email config.results_email = None -- 2.39.5