-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #532 from girder/no-unneeded-girder-worker
Don't use the girder worker fixture when it isn't needed.
- Loading branch information
Showing
5 changed files
with
10 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,11 @@ | |
import os | ||
import pytest | ||
import six | ||
import subprocess | ||
|
||
from girder import events | ||
from girder.models.folder import Folder | ||
from girder.models.setting import Setting | ||
from girder.models.upload import Upload | ||
|
||
from girder_worker.girder_plugin.constants import PluginSettings as WorkerSettings | ||
|
||
from test.utilities import externaldata | ||
|
||
|
||
|
@@ -67,27 +63,6 @@ def getBody(response, text=True): | |
return data | ||
|
||
|
||
@pytest.fixture | ||
def girderWorker(db): | ||
""" | ||
Run an instance of Girder worker, connected to rabbitmq. The rabbitmq | ||
service must be running. | ||
""" | ||
broker = 'amqp://[email protected]' | ||
Setting().set(WorkerSettings.BROKER, broker) | ||
Setting().set(WorkerSettings.BACKEND, broker) | ||
env = os.environ.copy() | ||
env['C_FORCE_ROOT'] = 'true' | ||
proc = subprocess.Popen([ | ||
'celery', '-A', 'girder_worker.app', 'worker', '--broker', broker, '--concurrency=1'], | ||
close_fds=True, env=env) | ||
yield True | ||
proc.terminate() | ||
proc.wait() | ||
Setting().unset(WorkerSettings.BROKER) | ||
Setting().unset(WorkerSettings.BACKEND) | ||
|
||
|
||
def unbindGirderEventsByHandlerName(handlerName): | ||
for eventName in events._mapping: | ||
events.unbind(eventName, handlerName) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.