removing the py script that took too many lines to do one simple thing

This commit is contained in:
Mendel Greenberg 2019-03-02 22:01:00 -05:00
parent 1be128b1f7
commit 16e766fedd
No known key found for this signature in database
GPG key ID: B26A7D2DF7DC6EF7
3 changed files with 8 additions and 38 deletions

View file

@ -1,6 +1,3 @@
language: python
python:
- "2.7"
env:
- DOCKER_COMPOSE_VERSION: 1.23.1
@ -19,14 +16,11 @@ before_install:
install:
- chmod ugo+x ./dbench
- chmod ugo+x ./test.sh
- ./dbench setup docker
- ./dbench init frappe-bench
- ./dbench new-site site1.local
- ./dbench setup hosts
- pip install --upgrade virtualenv
- virtualenv -p python3 testenv
- source testenv/bin/activate
- pip install requests
script:
- docker-compose ps | grep -i frappe
@ -34,5 +28,5 @@ script:
- docker-compose ps | grep -i redis-queue
- docker-compose ps | grep -i redis-socketio
- docker-compose ps | grep -i mariadb
- python test.py
- docker-compose stop
- ./test.sh
- ./dbench setup docker stop

29
test.py
View file

@ -1,29 +0,0 @@
import subprocess, requests, datetime, _thread, time, os, signal
start_time = datetime.datetime.now().time()
bench_start = 'docker exec -i frappe bash -c "bench start"'
process = subprocess.Popen(bench_start, stdout=subprocess.PIPE , 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:
global r
r = requests.get("http://localhost: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(30)
process.kill()
assert '<title> Login </title>' in str(r.content)

5
test.sh Normal file
View file

@ -0,0 +1,5 @@
#!/bin/bash
./dbench start > /tmp/bench.log &
curl --retry 20 --retry-delay 1 --retry-connrefused "http://localhost:8000/login" | grep '<title> Login </title>' || exit 1