2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-08 14:21:05 +00:00

amended commit

Former-commit-id: fa2b54c67c
This commit is contained in:
vishalseshagiri 2017-08-02 20:10:20 +05:30
parent dc5add7526
commit 5f6e0fc104
2 changed files with 30 additions and 8 deletions

View File

@ -18,8 +18,9 @@ install:
- docker exec -i frappe bash -c "bench --site site1.local install-app erpnext"
- docker exec -i -u root frappe bash -c "echo 127.0.0.1 site1.local >> /etc/hosts"
- sudo su -c 'echo 127.0.0.1 site1.local >> /etc/hosts'
- docker exec -id frappe bash -c "bench start"
- docker exec -it frappe bash -c "bench start"
- pip install requests
- pip install time
script:
- docker-compose ps | grep -i frappe

35
test.py
View File

@ -1,10 +1,31 @@
import subprocess,requests,time
import subprocess, requests, datetime, _thread, time, os, signal
start_time = datetime.datetime.now().time()
r = None
e = None
bench_start = 'docker exec -i frappe bash -c "bench start"'
process = subprocess.Popen(bench_start, shell=True)
def print_out(val,delay):
while 1:
time.sleep(delay)
if val == 1:
result,error = process.communicate()
print(result)
elif val == 2:
try:
r = requests.get("http://site1.local:8000")
print(r)
except requests.exceptions.ConnectionError as e:
print(e)
_thread.start_new_thread(print_out, (1, 1))
#result, error = process.communicate()
_thread.start_new_thread(print_out, (2, 1))
time.sleep(45)
try:
r = requests.get("site1.local:8000")
assert '<title> Login </title>' in r.content, "Login page failed to load"
except Exception as e:
traceback.print_exc(e)
sys.exit(3)
os.killpg(os.getpgid(process.pid), signal.SIGTERM) # Kill bench start
print(r.content)
assert '<title> Login </title>' in r.content, "Login page failed to load"