Commit 4976a356 authored by Aaron Jones's avatar Aaron Jones

Switched to Birmingham Enviroment for Software Testing to run continous integration

parent c1ee1f40
before_script:
- export CWD=$(pwd)
- export PYTHONPATH=$PYTHONPATH:$CWD
# - cd /finesse
# - rm kat
# - git reset --hard
# - git checkout develop
# - git pull
# - echo "Building Finesse..."
# - ./finesse.sh --build > /dev/null 2>&1
# - echo "Sucessfuly built Finesse"
- cd $CWD
python_3:
script:
- source /setup.sh
- echo $PYTHONIOENCODING
- kat -v
- which python3
- python3 --version
- cd test
- python3 run_tests.py
python_2:
script:
- source /setup.sh
- echo $PYTHONIOENCODING
- kat -v
- which python2.7
- python2.7 --version
- cd test
- python2.7 run_tests.py
\ No newline at end of file
Physics2.7:
script:
- python brumsofttest.py http://agentx20.sr.bham.ac.uk:9555/ 1 8 $CI_COMMIT_SHA
tags:
- best
Physics3.5:
script:
- python brumsofttest.py http://agentx20.sr.bham.ac.uk:9555/ 1 7 $CI_COMMIT_SHA
tags:
- best
# this will work with python 2.7 ONLY!
import sys,urllib,json,time
from requests import get
ip = get('https://api.ipify.org').text
print 'My public IP address is:', ip
SERVER = sys.argv[1]
USER_ID = sys.argv[2]
TEST_PROFILE = sys.argv[3]
GIT_CHECKOUT = sys.argv[4]
submit_url = SERVER + 'cli/submit_test/user/' +\
USER_ID + '/testProfile/' + TEST_PROFILE +\
'/gitcheckout/' + GIT_CHECKOUT
print('Requesting Test on URL: ' + str(submit_url))
response = urllib.urlopen(submit_url)
if response.getcode() != 200:
print(response.read())
raise Exception()
status_url = SERVER + 'cli/get_status/session/' +\
response.read() + '/user/' + USER_ID
print('Getting status from url: ' + str(status_url))
while True:
time.sleep(2)
new_response = urllib.urlopen(status_url)
status = json.load(new_response)['status']
if status == "Failed":
raise Exception("Test Failed!!")
elif status == "Passed":
exit()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment