From 6648e956d288c27155cc60ee3cf54b8fa054678d Mon Sep 17 00:00:00 2001 From: Antoine Lebrun Date: Thu, 17 May 2018 12:02:44 +0200 Subject: [PATCH] [WIP] add selenium yml file --- app/runtests.py | 21 +++++++++++++++------ docker-compose.yml | 1 + env/selenium.yml | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 env/selenium.yml diff --git a/app/runtests.py b/app/runtests.py index 2f9c2aee..61efbb0f 100644 --- a/app/runtests.py +++ b/app/runtests.py @@ -1,11 +1,13 @@ from subprocess import call -import sys +import organization +import sys, inspect tests_to_run = [] params = [] def choose_arguments(): print("\nToo few arguments. You can use : \n\n -all : to run all mezzo tests\n -mezzanine : to run only mezzanine tests") print(" -agenda : to run mezzanine-agenda tests \n -organization : to run mezzanine-organization tests\n -cartridge : to run cartridge tests ") - print(" --front : to run only front tests \n --back : to run only back tests\n\n You can also use all manage.py options ( as --failfast)") + print(" --front : to run only front tests \n --back : to run only back tests \n [PATH] = to run a test yourself") + print("\n You can also use all manage.py options ( as --failfast)") return input("\n'yes' to run all tests, 'no' to cancel : ") def execute(): @@ -23,7 +25,7 @@ def bad_arguments(): if choose_arguments()=='yes': add_all_tests() else: - sys.exit() + sys.exit() if len(sys.argv)==1: bad_arguments() @@ -35,6 +37,8 @@ else: params.append("--pattern=*back.py") elif arg == "-all": add_all_tests() + elif "/" in arg: + tests_to_run.append(arg) elif arg == "-agenda": tests_to_run.append("/srv/lib/mezzanine-agenda") elif arg == "-mezzanine": @@ -43,10 +47,15 @@ else: tests_to_run.append("/srv/lib/mezzanine-organization") elif arg == "-cartridge": tests_to_run.append("/srv/lib/cartridge") - elif arg!= "runtests.py": + elif "-" in arg: params.append(arg) -execute() - + elif arg!= "runtests.py": + tests_to_run.append(arg) + +if len(tests_to_run)>0: + execute() +else: + print("You have to specify a test suite") # All : python manage.py test /srv/lib/cartridge /srv/lib/mezzanine /srv/lib/mezzanine-agenda /srv/lib/mezzanine-organization --keepdb diff --git a/docker-compose.yml b/docker-compose.yml index ce072e9d..d881b869 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,3 +62,4 @@ app: nginx: image: nginx + diff --git a/env/selenium.yml b/env/selenium.yml new file mode 100644 index 00000000..57829abf --- /dev/null +++ b/env/selenium.yml @@ -0,0 +1,32 @@ +# To execute this docker-compose yml file use docker-compose -f up +# Add the "-d" flag at the end for deattached execution +firefox: + image: selenium/node-firefox:3.11.0-dysprosium + volumes: + - /dev/shm:/dev/shm + links: + - hub + environment: + HUB_HOST: hub + HUB_PORT: '4444' + +chrome: + image: selenium/node-chrome:3.11.0-dysprosium + volumes: + - /dev/shm:/dev/shm + links: + - hub + environment: + HUB_HOST: hub + HUB_PORT: '4444' + +hub: + image: selenium/hub:3.11.0-dysprosium + ports: + - "4444:4444" + expose: + - "4444" + +app: + links: + - hub \ No newline at end of file -- 2.39.5