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

Secret plugin configuration options #539

Merged
merged 3 commits into from
Jul 4, 2019
Merged

Secret plugin configuration options #539

merged 3 commits into from
Jul 4, 2019

Conversation

simonw
Copy link
Owner

@simonw simonw commented Jul 4, 2019

Refs #538

@simonw simonw changed the title Secret plugin configuration options, refs #538 Secret plugin configuration options Jul 4, 2019
@simonw
Copy link
Owner Author

simonw commented Jul 4, 2019

For some reason the way I have set these tests up keeps throwing variations on this error:

self = <click.testing.CliRunner object at 0x7fccc0d940f0>
    @contextlib.contextmanager
    def isolated_filesystem(self):
        """A context manager that creates a temporary folder and changes
        the current working directory to it for isolated filesystem tests.
        """
>       cwd = os.getcwd()
E       FileNotFoundError: [Errno 2] No such file or directory
/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/click/testing.py:364: FileNotFoundError

After much trial and error the cause appears to be the way I was trying to create custom metadata like so:

 def test_plugin_config_env():
    os.environ["FOO_ENV"] = "FROM_ENVIRONMENT"
    for client in make_app_client(
        metadata={"plugins": {"env-plugin": {"foo": {"$env": "FOO_ENV"}}}}
    ):
        assert {"foo": "FROM_ENVIRONMENT"} == client.ds.plugin_config("env-plugin")
    del os.environ["FOO_ENV"]

It wasnt't the os.environ manipulation OR the tempfile stuff - it appeared to be the usage of make_app_client(). When I stopped trying to do that (and moved my test configuration into METADATA in the fixtures.py module) the tests started passing again.

@simonw
Copy link
Owner Author

simonw commented Jul 4, 2019

This seems to have fixed the weird errors: fd6164b

@simonw simonw merged commit a2d4593 into master Jul 4, 2019
simonw added a commit that referenced this pull request Jul 7, 2019
simonw added a commit that referenced this pull request Nov 11, 2019
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.

1 participant