-
Notifications
You must be signed in to change notification settings - Fork 257
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
Allow plugins to have [env:name] and find plugins relatively based on… #1016
Open
pconerly
wants to merge
10
commits into
circus-tent:master
Choose a base branch
from
pconerly:relative-plugin
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2815f31
Allow plugins to have [env:name] and find plugins relatively based on…
pconerly 7b20a3f
Fix tests
pconerly 3b3399c
Close FD if they're not needed
pconerly 9879cb6
Tear down arbiter in this test
pconerly dd8d0ec
Add Peter Conerly to contributors
pconerly dface01
Merge remote-tracking branch 'upstream/master' into relative-plugin
pconerly ac47356
Fix merge
pconerly b3ebc96
self-review
pconerly 0c71666
Fix test_cfg_str
pconerly 0b282ba
Flake
pconerly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[plugin:relative_plugin] | ||
priority = 20 | ||
use = plugins_uniquename.my_plugin.MyPlugin | ||
stdout_stream.class = StdoutStream | ||
stderr_stream.class = StdoutStream | ||
# copy_env = True | ||
|
||
[env:relative_plugin] | ||
PYTHONPATH = $PWD/circus/tests/config |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from circus.tests.test_arbiter import EventLoggingTestPlugin | ||
|
||
|
||
# Plugin is the same as the EventLoggingTestPlugin, | ||
# just in a directory outside of the circus modules. | ||
class MyPlugin(EventLoggingTestPlugin): | ||
pass |
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from circus.plugins import _cfg2str, _str2cfg | ||
from circus.util import get_python_version | ||
from circus.tests.support import TestCase, EasyTestSuite | ||
|
||
|
||
class TestPluginUtils(TestCase): | ||
|
||
def test_cfg_str(self): | ||
data_obj = { | ||
'use': 'derp', | ||
'copy_env': True, | ||
'number': 1234, | ||
'env': { | ||
'PYTHONPATH': 'dot.path.to.whereever', | ||
'more_truth': True, | ||
}, | ||
} | ||
data_strung = _cfg2str(data_obj) | ||
|
||
# need to decode, like what would happen automatically when | ||
# passing an arg into and out of the commandline | ||
if get_python_version() < (3, 0, 0): | ||
return data_strung.decode('unicode-escape') | ||
data_unstrung = _str2cfg(data_strung) | ||
self.assertEqual(data_obj, data_unstrung) | ||
|
||
|
||
test_suite = EasyTestSuite(__name__) |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't think actually fixed the tests, but I think that it did help stop having dangling plugin processes (as in #1017 (comment) )