From 6968a6773a0e0eab2deb1f5046c04108e81ff72d Mon Sep 17 00:00:00 2001 From: James Adams Date: Mon, 4 Jun 2018 13:00:27 +0100 Subject: [PATCH] Test travis config Change-Id: I3dabb9e17d9ad4686a19336e121b1aceb925cf0d --- .travis.yml | 5 +++++ requirements.txt | 11 +++++++++++ tests/runtests.py | 17 ++++++++++------- tests/unittest.conf | 1 + tests/unittest.conf.noms | 2 ++ 5 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 .travis.yml create mode 100644 requirements.txt diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..3dbdb6787 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: python +python: + - "2.7" +script: + - tests/runtests.py -c tests/unittest.conf.noms -f --assume_yes diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..c2b5d09f2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,11 @@ +Twisted >= 12.2.0 +coverage +ipaddress +jsonschema +lxml +mako +psycopg2 >= 2.5.1 +python-dateutil +six >= 1.7.3 +sqlalchemy >= 0.9.7 +zope-interface diff --git a/tests/runtests.py b/tests/runtests.py index 3bf79e9fd..5224ca360 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -58,13 +58,14 @@ def force_yes(msg): print(msg, file=sys.stderr) - print(""" - Please confirm by typing yes (three letters) and pressing enter. - """, file=sys.stderr) - answer = sys.stdin.readline() - if not answer.startswith("yes"): - print("""Aborting.""", file=sys.stderr) - sys.exit(1) + if not opts.assume_yes: + print(""" + Please confirm by typing yes (three letters) and pressing enter. + """, file=sys.stderr) + answer = sys.stdin.readline() + if not answer.startswith("yes"): + print("""Aborting.""", file=sys.stderr) + sys.exit(1) parser = argparse.ArgumentParser(description="Run the broker test suite.", epilog=epilog) @@ -91,6 +92,8 @@ def force_yes(msg): parser.add_argument('-f', '--failfast', action='store_true', help='Add failfast=True option to TestRunner. This will stop ' 'unittests immediatelly if any failure.') +parser.add_argument('--assume_yes', action='store_true', + help='Assume yes to all questions, only use for continuous integration') opts = parser.parse_args() diff --git a/tests/unittest.conf b/tests/unittest.conf index 56f16b0ab..42c4b9c3b 100644 --- a/tests/unittest.conf +++ b/tests/unittest.conf @@ -69,6 +69,7 @@ checkedm = %(srcdir)s/tests/fakebin/fake_checkedm #aqd_checkedm = /ms/dist/aquilon/PROJ/edmtools/dev/bin/aqd_checkedm aqd_checkedm = %(srcdir)s/tests/fakebin/fake_aqd_checkedm location_uri_validator = /ms/dist/aquilon/PROJ/aqd-scripts/qa/bin/location_uri_validator +klist = %(srcdir)s/tests/fakebin/fake_klist [location_feeds] building_feed = %(srcdir)s/tests/fakebin/user-data/location_feed.csv diff --git a/tests/unittest.conf.noms b/tests/unittest.conf.noms index 6426ee527..64272ba95 100644 --- a/tests/unittest.conf.noms +++ b/tests/unittest.conf.noms @@ -68,6 +68,8 @@ get_camtable = %(srcdir)s/tests/fakebin/fake_macdata checkedm = %(srcdir)s/tests/fakebin/fake_checkedm aqd_checkedm = %(srcdir)s/tests/fakebin/fake_aqd_checkedm location_uri_validator = %(srcdir)s/tests/fakebin/location_uri_validator +klist = %(srcdir)s/tests/fakebin/fake_klist +git = /usr/bin/git # Alternative tool locations outside MS git_daemon = /usr/libexec/git-core/git-daemon