LLNL / merlin

Machine Learning for HPC Workflows
MIT License
118 stars 26 forks source link

Add Pytest Fixtures to Test Suite #456

Closed bgunnar5 closed 10 months ago

bgunnar5 commented 10 months ago

The branch I'm requesting to merge in is where I've been working on upgrades to the test suite. This PR contains the pytest fixtures that will be really helpful for writing tests. I want this merged now so I can write tests for the merlin monitor command in #452 (and also the third PR of the status command will likely need this).

I plan on finding a way to use these fixtures to improve the integration test suite in the future too, but for now this is sufficient to assist with the other PRs.

doutriaux1 commented 10 months ago

Thanks @bgunnar5 that looks nice (although seems to fail :) ). Are you planning to add coverage?

bgunnar5 commented 10 months ago

@doutriaux1 I forgot to check pylint before drafting this PR (oops!) so that's why this is failing. I do have plans to add coverage but I'd like to get what I have now merged first so I can get #452 finished up.

koning commented 10 months ago

Seems to work for the most part on LC:

=========================== short test summary info ============================ ERROR unit/study/test_celeryadapter.py::TestActiveQueues::test_query_celery_queues ERROR unit/study/test_celeryadapter.py::TestActiveQueues::test_get_running_queues ERROR unit/study/test_celeryadapter.py::TestActiveQueues::test_get_queues_active ERROR unit/study/test_celeryadapter.py::TestInactiveQueues::test_get_queues ======================== 63 passed, 4 errors in 52.25s =========================

bgunnar5 commented 10 months ago

@koning the fixtures use the merlin server command to start up a local server. What you're seeing is likely the weird issue with the merlin server command where you have to run export LC_ALL="C" before attempting to start the server.

koning commented 10 months ago

Yep, that fixed it, looks good:

============================ 67 passed in 58.52s ==============================