diff --git a/.travis.yml b/.travis.yml index 109ae1a..21f3fe3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ script: - ./scripts/build.sh; - ./test/test.sh unit.py # - ./test/test.sh component.py - - ./test/test.sh container.py --tag $TAG + - ./test/test.sh container.py --tag $COMMIT after_success: - set -e; diff --git a/test/container.py b/test/container.py index 8c540f5..d1beb60 100644 --- a/test/container.py +++ b/test/container.py @@ -48,14 +48,15 @@ def test_api_validated(self): if __name__ == '__main__': parser = argparse.ArgumentParser() - parser.add_argument('--tag', default="latest", help='The tag of the image to use. (default: latest)') + default_tag = "latest" + parser.add_argument('--tag', default=default_tag, help='The tag of the image to use. (default: latest)') parser.add_argument('unittest_args', nargs='*') args = parser.parse_args() PaymentContainerTest.TAG = args.tag - if os.environ["TAG"] != "": - PaymentContainerTest.TAG = os.environ["TAG"] - + if PaymentContainerTest.TAG == "": + PaymentContainerTest.TAG = default_tag + # Now set the sys.argv to the unittest_args (leaving sys.argv[0] alone) sys.argv[1:] = args.unittest_args unittest.main()