Fixed wrong import path
This commit is contained in:
19
runtests
19
runtests
@@ -20,7 +20,7 @@ from pathlib import Path
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from tests.conftest import check_ioc_running
|
from tests.conftest import check_ioc_running
|
||||||
from setup.classes import IocNotRunning
|
from src.classes import IocNotRunning
|
||||||
|
|
||||||
# Time we excpect the IOC needs to start up
|
# Time we excpect the IOC needs to start up
|
||||||
TIMEOUT_IOC_STARTUP = 10
|
TIMEOUT_IOC_STARTUP = 10
|
||||||
@@ -36,12 +36,12 @@ for arg in sys.argv[1:]:
|
|||||||
extra_args.append(arg)
|
extra_args.append(arg)
|
||||||
|
|
||||||
# Find all axes paths (pa) within all controller paths (pc)
|
# Find all axes paths (pa) within all controller paths (pc)
|
||||||
folders = []
|
folders = []
|
||||||
for pc in Path("tests").glob("*"):
|
for pc in Path("tests").glob("*"):
|
||||||
if pc.is_dir() and "__pycache__" not in pc.parts:
|
if pc.is_dir() and "__pycache__" not in pc.parts:
|
||||||
for pa in Path(pc).glob("*"):
|
for pa in Path(pc).glob("*"):
|
||||||
if pa.is_dir() and "__pycache__" not in pa.parts:
|
if pa.is_dir() and "__pycache__" not in pa.parts:
|
||||||
# Ignore all axis paths which start with an underscore
|
# Ignore all axis paths which start with an underscore
|
||||||
if not pa.parts[-1].startswith("_"):
|
if not pa.parts[-1].startswith("_"):
|
||||||
folders.append(pa)
|
folders.append(pa)
|
||||||
|
|
||||||
@@ -64,9 +64,9 @@ except IocNotRunning:
|
|||||||
print('Starting IOC ...')
|
print('Starting IOC ...')
|
||||||
# Start the IOC as a separate process, wait a bit and try again
|
# Start the IOC as a separate process, wait a bit and try again
|
||||||
path = Path(__file__).resolve().parent / 'ioc' / 'startioc'
|
path = Path(__file__).resolve().parent / 'ioc' / 'startioc'
|
||||||
p = subprocess.Popen([path],
|
p = subprocess.Popen([path],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
now = time.time()
|
now = time.time()
|
||||||
while now + TIMEOUT_IOC_STARTUP > time.time():
|
while now + TIMEOUT_IOC_STARTUP > time.time():
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
@@ -75,7 +75,8 @@ except IocNotRunning:
|
|||||||
except IocNotRunning:
|
except IocNotRunning:
|
||||||
pass
|
pass
|
||||||
check_ioc_running()
|
check_ioc_running()
|
||||||
print(f'Started IOC successfully (process ID {p.pid}). It will automatically terminate after all tests are done.')
|
print(
|
||||||
|
f'Started IOC successfully (process ID {p.pid}). It will automatically terminate after all tests are done.')
|
||||||
|
|
||||||
# Run each enabled folder's relevant tests in parallel
|
# Run each enabled folder's relevant tests in parallel
|
||||||
processes = []
|
processes = []
|
||||||
@@ -90,4 +91,4 @@ for proc in processes:
|
|||||||
code = proc.wait()
|
code = proc.wait()
|
||||||
if code != 0:
|
if code != 0:
|
||||||
exit_code = code
|
exit_code = code
|
||||||
sys.exit(exit_code)
|
sys.exit(exit_code)
|
||||||
|
|||||||
Reference in New Issue
Block a user