-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stability test for private pip install (#1521)
- Loading branch information
1 parent
4e3ec1a
commit 3743172
Showing
2 changed files
with
30 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
|
||
import pytest | ||
from distributed import PipInstall | ||
|
||
from ..utils_test import wait | ||
|
||
|
||
@pytest.mark.parametrize("restart_workers", [True, False]) | ||
def test_private_pip_install(small_client, restart_workers): | ||
small_client.cluster.send_private_envs( | ||
{"PYTHON_STUB_TOKEN": os.environ["PYTHON_STUB_PAT"]} | ||
) | ||
|
||
plugin = PipInstall( | ||
packages=[ | ||
"python_stub@git+https://${PYTHON_STUB_TOKEN}@github.com/coiled/python-stub.git" | ||
], | ||
restart_workers=restart_workers, | ||
) | ||
small_client.register_plugin(plugin) | ||
|
||
def test(x): | ||
from python_stub import stub | ||
|
||
return stub.echo(x) | ||
|
||
fut = small_client.submit(test, "Hello, world!") | ||
wait(fut, small_client, 5 * 60) |