aboutsummaryrefslogtreecommitdiffstats
path: root/functest/ci
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-06-30 06:24:11 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-06-30 14:32:52 +0200
commit678609610f4ccbcb19438cbce5d84bd376010596 (patch)
treef79c8abd8f04d99e586317e426fc05a68992badf /functest/ci
parentc426ee40d40434ea3a5d085f7b98d28fcdb063ff (diff)
Define console_scripts
Only prepare_env.py and run_tests.py remain executable to avoid breaking the gate. As soon as the jenkins jobs are updated to run them from $PATH, tox will be updated to protect against chmod a+x py files. Dockerfile will be simplified as well. Change-Id: Iac1a7ceb6b344e800177226ea39919826f6d3735 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/ci')
-rwxr-xr-xfunctest/ci/prepare_env.py10
-rwxr-xr-xfunctest/ci/run_tests.py7
2 files changed, 12 insertions, 5 deletions
diff --git a/functest/ci/prepare_env.py b/functest/ci/prepare_env.py
index 64fcc925..c633ef82 100755
--- a/functest/ci/prepare_env.py
+++ b/functest/ci/prepare_env.py
@@ -358,7 +358,7 @@ def print_deployment_info():
handler.get_deployment_info())
-def main(**kwargs):
+def prepare_env(**kwargs):
try:
if not (kwargs['action'] in actions):
logger.error('Argument not valid.')
@@ -384,9 +384,13 @@ def main(**kwargs):
return 0
-if __name__ == '__main__':
+def main():
logging.config.fileConfig(pkg_resources.resource_filename(
'functest', 'ci/logging.ini'))
parser = PrepareEnvParser()
args = parser.parse_args(sys.argv[1:])
- sys.exit(main(**args))
+ return prepare_env(**args)
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py
index 722df14f..5155adc4 100755
--- a/functest/ci/run_tests.py
+++ b/functest/ci/run_tests.py
@@ -269,10 +269,13 @@ class Runner(object):
return self.overall_result
-if __name__ == '__main__':
+def main():
logging.config.fileConfig(pkg_resources.resource_filename(
'functest', 'ci/logging.ini'))
parser = RunTestsParser()
args = parser.parse_args(sys.argv[1:])
runner = Runner()
- sys.exit(runner.main(**args).value)
+ return runner.main(**args).value
+
+if __name__ == '__main__':
+ sys.exit(main())