-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Implement serve flag for planemo test #1185
base: master
Are you sure you want to change the base?
Conversation
271426d
to
3ae767c
Compare
planemo/engine/test.py
Outdated
@@ -15,6 +22,17 @@ | |||
|
|||
def test_runnables(ctx, runnables, original_paths=None, **kwds): | |||
"""Return exit code indicating test or failure.""" | |||
if kwds.get("serve"): | |||
kwds["engine"] = "external_galaxy" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not this only works with that engine type in the option help?
0be55c4
to
97000c2
Compare
3e9f99c
to
7705734
Compare
This comment has been minimized.
This comment has been minimized.
Thats a nice idea! 👏 If you feel this is ready, do not forget to remove the WIP. |
Thanks!
@gallardoalba agreed to test it out, so I will keep it as WIP until then, but it seems to be working ok as far as I can tell. |
with temp_directory(dir=ctx.planemo_directory) as temp_path: | ||
with ExitStack() as stack: | ||
if not kwds["serve"]: | ||
temp_path = stack.enter_context(temp_directory(dir=ctx.planemo_directory)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fascinating! I had no clue about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, new for me as well, I came across it while searching for a way to write a conditional with statement.
pid = os.fork() | ||
if pid == 0: | ||
# wait for served Galaxy instance to start | ||
sleep(kwds["galaxy_url"], verbose=ctx.verbose, timeout=500) | ||
# then proceed to test against it | ||
kwds["engine"] = "external_galaxy" | ||
else: | ||
# serve Galaxy instance | ||
galaxy_serve(ctx, runnables, **kwds) | ||
exit(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forking in the presence of threads seems brittle. With #1232 we're removing the run_tests.sh mode, so you could just sleep infinitely in cmd_test.sh / cmd_shed_test.sh after merging this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement #1175.