Skip to content
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

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

simonbray
Copy link
Member

Implement #1175.

@simonbray simonbray force-pushed the serve-test branch 3 times, most recently from 271426d to 3ae767c Compare August 13, 2021 14:34
@@ -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"
Copy link
Member

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?

@simonbray simonbray changed the title [WIP] Implement serve flag for planemo test Implement serve flag for planemo test Aug 26, 2021
@simonbray simonbray changed the title Implement serve flag for planemo test [WIP] Implement serve flag for planemo test Sep 6, 2021
@simonbray simonbray force-pushed the serve-test branch 2 times, most recently from 0be55c4 to 97000c2 Compare October 12, 2021 12:59
@simonbray simonbray force-pushed the serve-test branch 2 times, most recently from 3e9f99c to 7705734 Compare October 13, 2021 09:28
@simonbray

This comment has been minimized.

@bgruening
Copy link
Member

Thats a nice idea! 👏

If you feel this is ready, do not forget to remove the WIP.

@simonbray
Copy link
Member Author

Thats a nice idea! 👏

Thanks!

If you feel this is ready, do not forget to remove the WIP.

@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))
Copy link
Member

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.

Copy link
Member Author

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.

Comment on lines +29 to +38
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)
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mvdbeek, I'll have another look when #1232 gets merged.

@simonbray simonbray marked this pull request as draft June 13, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants