locust-cloud 1.23.3.dev3__tar.gz → 1.23.3.dev10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/.github/workflows/daily-check.yml +5 -5
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/.github/workflows/tests.yml +5 -5
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/PKG-INFO +1 -1
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/args.py +1 -5
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/cloud.py +6 -4
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/tests/args_test.py +0 -11
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/tests/cloud_test.py +3 -4
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/.gitignore +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/.pre-commit-config.yaml +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/.vscode/extensions.json +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/.vscode/launch.json +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/.vscode/settings.json +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/LICENSE +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/README.md +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/__init__.py +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/actions.py +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/apisession.py +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/common.py +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/docs/.gitignore +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/docs/1-first-run.rst +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/docs/2-examples.rst +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/docs/images/locust-cloud-screenshot.png +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/docs/locust-cloud.rst +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/input_events.py +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/web_login.py +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locust_cloud/websocket.py +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/locustfile.py +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/pyproject.toml +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/testdata/extra-files/extra.txt +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/testdata/extra-package/example/__init__.py +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/testdata/extra-package/setup.py +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/testdata/requirements.txt +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/tests/web_login_test.py +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/tests/websocket_test.py +0 -0
- {locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/uv.lock +0 -0
@@ -2,7 +2,7 @@ name: Daily test run (api-dev)
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
schedule: # 00:00, skipping Sunday and Monday
|
5
|
-
- cron:
|
5
|
+
- cron: "0 0 * * 2-6"
|
6
6
|
workflow_dispatch:
|
7
7
|
|
8
8
|
env:
|
@@ -26,7 +26,7 @@ jobs:
|
|
26
26
|
fetch-tags: true
|
27
27
|
- uses: actions/setup-python@v5
|
28
28
|
with:
|
29
|
-
|
29
|
+
python-version: "3.11"
|
30
30
|
- uses: astral-sh/setup-uv@v2
|
31
31
|
- uses: actions/setup-node@v4
|
32
32
|
with:
|
@@ -34,8 +34,8 @@ jobs:
|
|
34
34
|
- run: uv venv --python 3.11
|
35
35
|
# any local changes would make hatch-vcs set a "local version" (+dev0...), so we ignore any uv.lock updates:
|
36
36
|
- run: git update-index --assume-unchanged uv.lock
|
37
|
-
- run:
|
38
|
-
- run:
|
37
|
+
- run: uvx --with . locust --cloud --help
|
38
|
+
- run: uvx --with . locust --cloud --profile status-checker --mock-server --autostart --autoquit 0 --run-time 1m --loglevel DEBUG --extra-files testdata/extra-files --extra-packages testdata/extra-package --requirements testdata/requirements.txt |& tee output.txt
|
39
39
|
# check ok exit
|
40
40
|
- run: grep -m 1 '(exit code 0)' output.txt
|
41
41
|
# check extra files specified were available
|
@@ -55,4 +55,4 @@ jobs:
|
|
55
55
|
run: curl -d "{\"text\":\"Failed run $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\"}" $SLACK_NOTIFICATIONS_WEBHOOK
|
56
56
|
- name: Make sure to delete (only really needed for mock)
|
57
57
|
if: always()
|
58
|
-
run:
|
58
|
+
run: uvx --with . locust --delete
|
@@ -28,10 +28,10 @@ jobs:
|
|
28
28
|
# This peculiar way of running pytest is to ensure monkey patching is done before pytest starts loading modules.
|
29
29
|
# Otherwise you may get "MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported" and infinite recursion
|
30
30
|
# https://github.com/pytest-dev/pytest/issues/6210
|
31
|
-
- run: uv run python -m gevent.monkey --module pytest
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
# - run: uv run --with locust --with . python -m gevent.monkey --module pytest
|
32
|
+
# env:
|
33
|
+
# LOCUSTCLOUD_USERNAME: ${{ secrets.LOCUSTCLOUD_USERNAME }}
|
34
|
+
# LOCUSTCLOUD_PASSWORD: ${{ secrets.LOCUSTCLOUD_PASSWORD }}
|
35
35
|
# any local changes would make hatch-vcs set a "local version" (+dev0...), so we ignore any uv.lock updates:
|
36
36
|
- run: git update-index --assume-unchanged uv.lock
|
37
37
|
- run: uvx --from build pyproject-build --sdist --wheel --installer uv
|
@@ -41,7 +41,7 @@ jobs:
|
|
41
41
|
path: dist/*
|
42
42
|
# Ensure what customers will actually run does not rely on dev-dependencies
|
43
43
|
- run: rm -rf uv.lock .venv
|
44
|
-
- run: uv run --no-default-groups locust
|
44
|
+
- run: uv run --with locust --with . --no-default-groups locust --cloud --help
|
45
45
|
|
46
46
|
publish_pypi:
|
47
47
|
name: Publish to PyPI
|
@@ -288,14 +288,10 @@ Parameters specified on command line override env vars, which in turn override c
|
|
288
288
|
add_config_file_help=False,
|
289
289
|
add_env_var_help=False,
|
290
290
|
)
|
291
|
+
# We do not use this, but we keep it here to consume it from CLI if provided
|
291
292
|
combined_cloud_parser.add_argument(
|
292
293
|
"-f",
|
293
294
|
"--locustfile",
|
294
|
-
metavar="<filename>",
|
295
|
-
default="locustfile.py",
|
296
|
-
help="The Python file that contains your test. Defaults to 'locustfile.py'.",
|
297
|
-
env_var="LOCUST_LOCUSTFILE",
|
298
|
-
type=transfer_encoded_file,
|
299
295
|
)
|
300
296
|
combined_cloud_parser.add_argument(
|
301
297
|
"-u",
|
@@ -7,7 +7,7 @@ from threading import Thread
|
|
7
7
|
import requests
|
8
8
|
from locust_cloud.actions import delete
|
9
9
|
from locust_cloud.apisession import ApiSession
|
10
|
-
from locust_cloud.args import combined_cloud_parser
|
10
|
+
from locust_cloud.args import combined_cloud_parser, transfer_encoded_file
|
11
11
|
from locust_cloud.common import __version__
|
12
12
|
from locust_cloud.input_events import input_listener
|
13
13
|
from locust_cloud.websocket import SessionMismatchError, Websocket, WebsocketTimeout
|
@@ -27,15 +27,17 @@ def configure_logging(loglevel: str) -> None:
|
|
27
27
|
logging.getLogger("urllib3").setLevel(logging.INFO)
|
28
28
|
|
29
29
|
|
30
|
-
def main():
|
30
|
+
def main(locustfiles: list[str]):
|
31
31
|
options, locust_options = combined_cloud_parser.parse_known_args()
|
32
32
|
|
33
33
|
configure_logging(options.loglevel)
|
34
34
|
|
35
|
-
if not
|
35
|
+
if not locustfiles:
|
36
36
|
logger.error("A locustfile is required to run a test.")
|
37
37
|
return 1
|
38
38
|
|
39
|
+
s3_locustfiles = [transfer_encoded_file(locustfile) for locustfile in locustfiles]
|
40
|
+
|
39
41
|
session = ApiSession(options.non_interactive)
|
40
42
|
websocket = Websocket()
|
41
43
|
|
@@ -67,7 +69,7 @@ def main():
|
|
67
69
|
|
68
70
|
payload = {
|
69
71
|
"locust_args": locust_args,
|
70
|
-
"locustfile":
|
72
|
+
"locustfile": s3_locustfiles,
|
71
73
|
"user_count": options.users,
|
72
74
|
"mock_server": options.mock_server,
|
73
75
|
}
|
@@ -79,17 +79,6 @@ def test_transfer_encoded_args_files():
|
|
79
79
|
assert zf.namelist() == ["testdata/extra-files/extra.txt"]
|
80
80
|
|
81
81
|
|
82
|
-
def test_parser_locustfile(capsys):
|
83
|
-
with pytest.raises(SystemExit):
|
84
|
-
combined_cloud_parser.parse_known_args("locust-cloud --locustfile does-not-exist")
|
85
|
-
|
86
|
-
expected = "error: argument -f/--locustfile: File not found: does-not-exist"
|
87
|
-
assert expected in capsys.readouterr().err
|
88
|
-
|
89
|
-
options, _ = combined_cloud_parser.parse_known_args("locust-cloud --locustfile testdata/extra-files/extra.txt")
|
90
|
-
assert options.locustfile == transfer_encoded_file("testdata/extra-files/extra.txt")
|
91
|
-
|
92
|
-
|
93
82
|
def test_parser_extra_files(capsys):
|
94
83
|
with pytest.raises(SystemExit):
|
95
84
|
combined_cloud_parser.parse_known_args("locust-cloud --extra-files ../pineapple")
|
@@ -70,14 +70,13 @@ def test_cli_auth() -> None:
|
|
70
70
|
}
|
71
71
|
|
72
72
|
# Check that we get the message that login is required
|
73
|
-
process = subprocess.
|
74
|
-
process.wait(timeout=1)
|
73
|
+
process = subprocess.run(["locust", "--cloud"], env=env, capture_output=True, text=True, timeout=1)
|
75
74
|
assert process.stdout # typing, not testing...
|
76
|
-
assert unauthorized_message in process.stdout
|
75
|
+
assert unauthorized_message in process.stdout
|
77
76
|
|
78
77
|
# Do a locust-cloud --login
|
79
78
|
process = subprocess.Popen(
|
80
|
-
["locust
|
79
|
+
["locust", "--login"],
|
81
80
|
env=env,
|
82
81
|
stdout=subprocess.PIPE,
|
83
82
|
stdin=subprocess.PIPE,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{locust_cloud-1.23.3.dev3 → locust_cloud-1.23.3.dev10}/testdata/extra-package/example/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|