testzeus-cli 0.0.22__tar.gz → 0.0.25__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.
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/PKG-INFO +1 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/pyproject.toml +1 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/device_pool.py +1 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/environments.py +97 -39
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/extensions.py +4 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/hypermind_code_blocks.py +4 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/knowledge_bases.py +4 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/notification_channels.py +1 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/tags.py +4 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_data.py +7 -19
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_report_schedules.py +4 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_run_groups.py +3 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_runs.py +159 -9
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_suite_node_runs.py +1 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_suite_runs.py +4 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_suite_schedules.py +1 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/test_suites.py +9 -2
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/tests.py +9 -2
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/tests_ai_generator.py +1 -1
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/user_integrations.py +6 -2
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/utils/formatters.py +61 -51
- testzeus_cli-0.0.25/testzeus_cli/utils/links.py +49 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/LICENSE +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/README.md +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/__init__.py +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/auth.py +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/cli.py +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/__init__.py +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/daemon.py +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/commands/tests_authoring.py +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/config.py +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/utils/__init__.py +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/utils/auth.py +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/utils/client.py +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/utils/files.py +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/utils/profile.py +0 -0
- {testzeus_cli-0.0.22 → testzeus_cli-0.0.25}/testzeus_cli/utils/validators.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "testzeus-cli"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.25"
|
|
8
8
|
description = "Command-line interface for TestZeus testing platform"
|
|
9
9
|
authors = ["Shriyansh Agnihotri <shriyansh@testzeus.com>"]
|
|
10
10
|
readme = "README.md"
|
|
@@ -27,7 +27,7 @@ def device_pool_group():
|
|
|
27
27
|
@click.option(
|
|
28
28
|
"--filters", "-f", multiple=True, help="Filter results (format: key=value, e.g. platform=android)"
|
|
29
29
|
)
|
|
30
|
-
@click.option("--sort", help="Sort by field (e.g. device_name, -platform_version)")
|
|
30
|
+
@click.option("--sort", default="-updated", show_default=True, help="Sort by field (e.g. device_name, -platform_version)")
|
|
31
31
|
@click.option("--page", default=1, help="Page number")
|
|
32
32
|
@click.option("--per-page", default=50, help="Items per page")
|
|
33
33
|
@click.pass_context
|
|
@@ -3,6 +3,7 @@ Environment management commands for TestZeus CLI.
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import asyncio
|
|
6
|
+
import builtins
|
|
6
7
|
import json
|
|
7
8
|
import click
|
|
8
9
|
from pathlib import Path
|
|
@@ -15,6 +16,7 @@ from testzeus_cli.utils.formatters import format_output, print_message
|
|
|
15
16
|
from testzeus_cli.utils.auth import initialize_client_with_token
|
|
16
17
|
from testzeus_cli.utils.validators import parse_key_value_pairs, validate_tenant_ownership
|
|
17
18
|
from testzeus_cli.utils.files import match_stored_file
|
|
19
|
+
from testzeus_cli.utils.links import print_platform_link
|
|
18
20
|
|
|
19
21
|
console = Console()
|
|
20
22
|
|
|
@@ -51,14 +53,27 @@ def _validate_and_serialize_data(raw_data: str) -> str:
|
|
|
51
53
|
raise click.BadParameter(str(e))
|
|
52
54
|
|
|
53
55
|
|
|
54
|
-
def _validate_device_type_options(
|
|
55
|
-
|
|
56
|
+
def _validate_device_type_options(
|
|
57
|
+
device_type, file, mobile_file, connected_environments, mobile_device=None
|
|
58
|
+
):
|
|
59
|
+
"""Validate CLI options against device_type constraints.
|
|
60
|
+
|
|
61
|
+
browser: --file / --connected-environments allowed;
|
|
62
|
+
--mobile-file / --mobile-device forbidden.
|
|
63
|
+
mobile-*: --mobile-file / --mobile-device allowed;
|
|
64
|
+
--file / --connected-environments forbidden.
|
|
65
|
+
"""
|
|
56
66
|
if device_type == "browser":
|
|
57
67
|
if mobile_file:
|
|
58
68
|
raise click.UsageError(
|
|
59
69
|
"--mobile-file cannot be used with --device-type=browser. "
|
|
60
70
|
"Use --file for browser environments."
|
|
61
71
|
)
|
|
72
|
+
if mobile_device:
|
|
73
|
+
raise click.UsageError(
|
|
74
|
+
"--mobile-device cannot be used with --device-type=browser. "
|
|
75
|
+
"It is only valid for mobile-android/mobile-ios."
|
|
76
|
+
)
|
|
62
77
|
elif device_type in MOBILE_DEVICE_TYPES:
|
|
63
78
|
if file:
|
|
64
79
|
raise click.UsageError(
|
|
@@ -71,6 +86,40 @@ def _validate_device_type_options(device_type, file, mobile_file, connected_envi
|
|
|
71
86
|
)
|
|
72
87
|
|
|
73
88
|
|
|
89
|
+
def _filter_environment_output(data: dict) -> dict:
|
|
90
|
+
"""Omit fields that do not apply to the environment's device_type."""
|
|
91
|
+
if not isinstance(data, dict):
|
|
92
|
+
return data
|
|
93
|
+
device_type = data.get("device_type") or "browser"
|
|
94
|
+
filtered = dict(data)
|
|
95
|
+
if device_type in MOBILE_DEVICE_TYPES:
|
|
96
|
+
filtered.pop("supporting_data_files", None)
|
|
97
|
+
filtered.pop("supporting_data_files_info", None)
|
|
98
|
+
filtered.pop("connected_environments", None)
|
|
99
|
+
filtered.pop("browser_auth_file", None)
|
|
100
|
+
filtered.pop("browser_auth_file_info", None)
|
|
101
|
+
filtered.pop("email_manager", None)
|
|
102
|
+
else:
|
|
103
|
+
filtered.pop("mobile_supporting_data_file", None)
|
|
104
|
+
filtered.pop("mobile_supporting_data_file_info", None)
|
|
105
|
+
filtered.pop("mobile_device", None)
|
|
106
|
+
return filtered
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def _filter_environment_list_output(result):
|
|
110
|
+
"""Filter list payloads (dict with items or raw list) by device_type."""
|
|
111
|
+
# builtins.list: this module's Click command is named `list` and shadows
|
|
112
|
+
# the builtin at runtime when isinstance() is evaluated.
|
|
113
|
+
if isinstance(result, dict) and isinstance(result.get("items"), builtins.list):
|
|
114
|
+
return {
|
|
115
|
+
**result,
|
|
116
|
+
"items": [_filter_environment_output(item) for item in result["items"]],
|
|
117
|
+
}
|
|
118
|
+
if isinstance(result, builtins.list):
|
|
119
|
+
return [_filter_environment_output(item) for item in result]
|
|
120
|
+
return _filter_environment_output(result)
|
|
121
|
+
|
|
122
|
+
|
|
74
123
|
@click.group()
|
|
75
124
|
def environments_group():
|
|
76
125
|
"""Manage environments in TestZeus"""
|
|
@@ -85,9 +134,6 @@ def environments_group():
|
|
|
85
134
|
default="browser",
|
|
86
135
|
help="Device type (default: browser)",
|
|
87
136
|
)
|
|
88
|
-
@click.option(
|
|
89
|
-
"--status", default="draft", help="Environment status (draft, ready, deleted)"
|
|
90
|
-
)
|
|
91
137
|
@click.option("--data", help=DATA_FORMAT_HELP)
|
|
92
138
|
@click.option(
|
|
93
139
|
"--data-file",
|
|
@@ -111,6 +157,10 @@ def environments_group():
|
|
|
111
157
|
type=click.Path(exists=True),
|
|
112
158
|
help="Path to mobile app file - APK/ZIP (mobile only)",
|
|
113
159
|
)
|
|
160
|
+
@click.option(
|
|
161
|
+
"--mobile-device",
|
|
162
|
+
help="Device pool ID or device_name (mobile only; use 'device-pool list' to discover)",
|
|
163
|
+
)
|
|
114
164
|
@click.option(
|
|
115
165
|
"--email-manager",
|
|
116
166
|
help="Comma-separated list of email manager integration IDs or names (browser only)",
|
|
@@ -123,12 +173,8 @@ def environments_group():
|
|
|
123
173
|
"--agent-grounding-prompt",
|
|
124
174
|
help="Agent grounding prompt (JSON string)",
|
|
125
175
|
)
|
|
126
|
-
@click.option(
|
|
127
|
-
"--device-config",
|
|
128
|
-
help="Device configuration (JSON string)",
|
|
129
|
-
)
|
|
130
176
|
@click.pass_context
|
|
131
|
-
def create(ctx, name, device_type,
|
|
177
|
+
def create(ctx, name, device_type, data, data_file, tags, connected_environments, file, mobile_file, mobile_device, email_manager, source_code_integrations, agent_grounding_prompt):
|
|
132
178
|
"""Create a new environment"""
|
|
133
179
|
|
|
134
180
|
if data and data_file:
|
|
@@ -138,7 +184,9 @@ def create(ctx, name, device_type, status, data, data_file, tags, connected_envi
|
|
|
138
184
|
if not is_mobile and not data and not data_file:
|
|
139
185
|
raise click.UsageError("Either --data or --data-file is required for browser environments")
|
|
140
186
|
|
|
141
|
-
_validate_device_type_options(
|
|
187
|
+
_validate_device_type_options(
|
|
188
|
+
device_type, file, mobile_file, connected_environments, mobile_device=mobile_device
|
|
189
|
+
)
|
|
142
190
|
|
|
143
191
|
data_content = None
|
|
144
192
|
if data_file:
|
|
@@ -162,7 +210,6 @@ def create(ctx, name, device_type, status, data, data_file, tags, connected_envi
|
|
|
162
210
|
params = {
|
|
163
211
|
"name": name,
|
|
164
212
|
"device_type": device_type,
|
|
165
|
-
"status": status,
|
|
166
213
|
"tenant": stored_tenant_id,
|
|
167
214
|
"modified_by": stored_user_id,
|
|
168
215
|
"metadata": "{}",
|
|
@@ -177,6 +224,9 @@ def create(ctx, name, device_type, status, data, data_file, tags, connected_envi
|
|
|
177
224
|
if connected_environments:
|
|
178
225
|
params["connected_environments"] = connected_environments.split(",")
|
|
179
226
|
|
|
227
|
+
if mobile_device:
|
|
228
|
+
params["mobile_device"] = mobile_device
|
|
229
|
+
|
|
180
230
|
if email_manager:
|
|
181
231
|
params["email_manager"] = email_manager.split(",")
|
|
182
232
|
|
|
@@ -186,9 +236,6 @@ def create(ctx, name, device_type, status, data, data_file, tags, connected_envi
|
|
|
186
236
|
if agent_grounding_prompt:
|
|
187
237
|
params["agent_grounding_prompt"] = agent_grounding_prompt
|
|
188
238
|
|
|
189
|
-
if device_config:
|
|
190
|
-
params["device_config"] = device_config
|
|
191
|
-
|
|
192
239
|
if file:
|
|
193
240
|
try:
|
|
194
241
|
params["supporting_data_files"] = FileUpload(file, open(file, "rb"))
|
|
@@ -204,7 +251,7 @@ def create(ctx, name, device_type, status, data, data_file, tags, connected_envi
|
|
|
204
251
|
exit(1)
|
|
205
252
|
|
|
206
253
|
env = await client.environments.create(params)
|
|
207
|
-
return env.data
|
|
254
|
+
return _filter_environment_output(env.data)
|
|
208
255
|
|
|
209
256
|
try:
|
|
210
257
|
result = asyncio.run(_run())
|
|
@@ -221,7 +268,7 @@ def create(ctx, name, device_type, status, data, data_file, tags, connected_envi
|
|
|
221
268
|
@click.option(
|
|
222
269
|
"--filters", "-f", multiple=True, help="Filter results (format: key=value)"
|
|
223
270
|
)
|
|
224
|
-
@click.option("--sort", help="Sort by field")
|
|
271
|
+
@click.option("--sort", default="-updated", show_default=True, help="Sort by field")
|
|
225
272
|
@click.option("--expand", help="Expand related entities")
|
|
226
273
|
@click.pass_context
|
|
227
274
|
def list(ctx, filters, sort, expand):
|
|
@@ -244,7 +291,8 @@ def list(ctx, filters, sort, expand):
|
|
|
244
291
|
|
|
245
292
|
try:
|
|
246
293
|
result = asyncio.run(_run())
|
|
247
|
-
|
|
294
|
+
print_platform_link(ctx, "environments")
|
|
295
|
+
format_output(_filter_environment_list_output(result), ctx.obj["FORMAT"])
|
|
248
296
|
except Exception as e:
|
|
249
297
|
print_message(f"[red]Error listing environments: {str(e)}[/red]", ctx.obj["FORMAT"])
|
|
250
298
|
raise click.Abort()
|
|
@@ -299,10 +347,11 @@ def get(ctx, env_id, expand):
|
|
|
299
347
|
else:
|
|
300
348
|
await client.ensure_authenticated()
|
|
301
349
|
env = await client.environments.get_one(env_id, expand=expand)
|
|
302
|
-
return env.data
|
|
350
|
+
return _filter_environment_output(env.data)
|
|
303
351
|
|
|
304
352
|
try:
|
|
305
353
|
result = asyncio.run(_run())
|
|
354
|
+
print_platform_link(ctx, "environments")
|
|
306
355
|
format_output(result, ctx.obj["FORMAT"])
|
|
307
356
|
except Exception as e:
|
|
308
357
|
print_message(f"[red]Error getting environment: {str(e)}[/red]", ctx.obj["FORMAT"])
|
|
@@ -317,7 +366,6 @@ def get(ctx, env_id, expand):
|
|
|
317
366
|
type=click.Choice(["browser", "mobile-android", "mobile-ios"]),
|
|
318
367
|
help="Device type",
|
|
319
368
|
)
|
|
320
|
-
@click.option("--status", help="New environment status (draft, ready, deleted)")
|
|
321
369
|
@click.option("--data", help=DATA_FORMAT_HELP)
|
|
322
370
|
@click.option(
|
|
323
371
|
"--data-file",
|
|
@@ -341,6 +389,10 @@ def get(ctx, env_id, expand):
|
|
|
341
389
|
type=click.Path(exists=True),
|
|
342
390
|
help="Path to mobile app file - APK/ZIP (mobile only)",
|
|
343
391
|
)
|
|
392
|
+
@click.option(
|
|
393
|
+
"--mobile-device",
|
|
394
|
+
help="Device pool ID or device_name (mobile only; use 'none' to clear)",
|
|
395
|
+
)
|
|
344
396
|
@click.option(
|
|
345
397
|
"--email-manager",
|
|
346
398
|
help="Comma-separated list of email manager integration IDs or names (browser only, use 'none' to clear)",
|
|
@@ -353,19 +405,23 @@ def get(ctx, env_id, expand):
|
|
|
353
405
|
"--agent-grounding-prompt",
|
|
354
406
|
help="Agent grounding prompt (JSON string, use 'none' to clear)",
|
|
355
407
|
)
|
|
356
|
-
@click.option(
|
|
357
|
-
"--device-config",
|
|
358
|
-
help="Device configuration (JSON string, use 'none' to clear)",
|
|
359
|
-
)
|
|
360
408
|
@click.pass_context
|
|
361
|
-
def update(ctx, env_id, name, device_type,
|
|
409
|
+
def update(ctx, env_id, name, device_type, data, data_file, tags, connected_environments, file, mobile_file, mobile_device, email_manager, source_code_integrations, agent_grounding_prompt):
|
|
362
410
|
"""Update an environment"""
|
|
363
411
|
|
|
364
412
|
if data and data_file:
|
|
365
413
|
raise click.UsageError("Cannot use both --data and --data-file")
|
|
366
414
|
|
|
415
|
+
# Treat 'none' as a clear request for validation purposes (still mobile-only)
|
|
416
|
+
mobile_device_for_validation = None if mobile_device == "none" else mobile_device
|
|
367
417
|
if device_type:
|
|
368
|
-
_validate_device_type_options(
|
|
418
|
+
_validate_device_type_options(
|
|
419
|
+
device_type,
|
|
420
|
+
file,
|
|
421
|
+
mobile_file,
|
|
422
|
+
connected_environments,
|
|
423
|
+
mobile_device=mobile_device_for_validation,
|
|
424
|
+
)
|
|
369
425
|
|
|
370
426
|
data_content = None
|
|
371
427
|
if data_file:
|
|
@@ -389,7 +445,13 @@ def update(ctx, env_id, name, device_type, status, data, data_file, tags, connec
|
|
|
389
445
|
validate_tenant_ownership(env.data, tenant_id, "environment")
|
|
390
446
|
|
|
391
447
|
effective_device_type = device_type or env.device_type
|
|
392
|
-
_validate_device_type_options(
|
|
448
|
+
_validate_device_type_options(
|
|
449
|
+
effective_device_type,
|
|
450
|
+
file,
|
|
451
|
+
mobile_file,
|
|
452
|
+
connected_environments,
|
|
453
|
+
mobile_device=mobile_device_for_validation,
|
|
454
|
+
)
|
|
393
455
|
|
|
394
456
|
updates = {"tenant": tenant_id, "modified_by": user_id}
|
|
395
457
|
has_updates = False
|
|
@@ -402,10 +464,6 @@ def update(ctx, env_id, name, device_type, status, data, data_file, tags, connec
|
|
|
402
464
|
updates["device_type"] = device_type
|
|
403
465
|
has_updates = True
|
|
404
466
|
|
|
405
|
-
if status:
|
|
406
|
-
updates["status"] = status
|
|
407
|
-
has_updates = True
|
|
408
|
-
|
|
409
467
|
if data_content:
|
|
410
468
|
updates["data"] = data_content
|
|
411
469
|
has_updates = True
|
|
@@ -425,6 +483,13 @@ def update(ctx, env_id, name, device_type, status, data, data_file, tags, connec
|
|
|
425
483
|
updates["connected_environments"] = connected_environments.split(",")
|
|
426
484
|
has_updates = True
|
|
427
485
|
|
|
486
|
+
if mobile_device:
|
|
487
|
+
if mobile_device == "none":
|
|
488
|
+
updates["mobile_device"] = None
|
|
489
|
+
else:
|
|
490
|
+
updates["mobile_device"] = mobile_device
|
|
491
|
+
has_updates = True
|
|
492
|
+
|
|
428
493
|
if email_manager:
|
|
429
494
|
if email_manager == "none":
|
|
430
495
|
updates["email_manager"] = None
|
|
@@ -446,13 +511,6 @@ def update(ctx, env_id, name, device_type, status, data, data_file, tags, connec
|
|
|
446
511
|
updates["agent_grounding_prompt"] = agent_grounding_prompt
|
|
447
512
|
has_updates = True
|
|
448
513
|
|
|
449
|
-
if device_config:
|
|
450
|
-
if device_config == "none":
|
|
451
|
-
updates["device_config"] = None
|
|
452
|
-
else:
|
|
453
|
-
updates["device_config"] = device_config
|
|
454
|
-
has_updates = True
|
|
455
|
-
|
|
456
514
|
if file:
|
|
457
515
|
try:
|
|
458
516
|
updates["supporting_data_files"] = FileUpload(
|
|
@@ -475,7 +533,7 @@ def update(ctx, env_id, name, device_type, status, data, data_file, tags, connec
|
|
|
475
533
|
|
|
476
534
|
if has_updates:
|
|
477
535
|
updated_env = await client.environments.update(env_id, updates)
|
|
478
|
-
return updated_env.data
|
|
536
|
+
return _filter_environment_output(updated_env.data)
|
|
479
537
|
else:
|
|
480
538
|
print_message("[yellow]No updates provided[/yellow]", ctx.obj["FORMAT"])
|
|
481
539
|
return None
|
|
@@ -13,6 +13,7 @@ from testzeus_cli.config import get_client_config
|
|
|
13
13
|
from testzeus_cli.utils.formatters import format_output, print_message
|
|
14
14
|
from testzeus_cli.utils.validators import validate_id, validate_tenant_ownership, parse_key_value_pairs
|
|
15
15
|
from testzeus_cli.utils.auth import initialize_client_with_token
|
|
16
|
+
from testzeus_cli.utils.links import print_platform_link
|
|
16
17
|
|
|
17
18
|
console = Console()
|
|
18
19
|
|
|
@@ -27,7 +28,7 @@ def extensions_group():
|
|
|
27
28
|
@click.option(
|
|
28
29
|
"--filters", "-f", multiple=True, help="Filter results (format: key=value)"
|
|
29
30
|
)
|
|
30
|
-
@click.option("--sort", help="Sort by field")
|
|
31
|
+
@click.option("--sort", default="-updated", show_default=True, help="Sort by field")
|
|
31
32
|
@click.option("--expand", help="Expand related entities (comma-separated)")
|
|
32
33
|
@click.option("--page", default=1, help="Page number")
|
|
33
34
|
@click.option("--per-page", default=50, help="Items per page")
|
|
@@ -55,6 +56,7 @@ def list_extensions(ctx, filters, sort, expand, page, per_page):
|
|
|
55
56
|
return extensions
|
|
56
57
|
|
|
57
58
|
result = asyncio.run(_run())
|
|
59
|
+
print_platform_link(ctx, "training-runs")
|
|
58
60
|
format_output(result, ctx.obj["FORMAT"])
|
|
59
61
|
|
|
60
62
|
|
|
@@ -85,6 +87,7 @@ def get_extension(ctx, extension_id, expand):
|
|
|
85
87
|
return extension.data
|
|
86
88
|
|
|
87
89
|
result = asyncio.run(_run())
|
|
90
|
+
print_platform_link(ctx, "training-runs")
|
|
88
91
|
format_output(result, ctx.obj["FORMAT"])
|
|
89
92
|
|
|
90
93
|
|
|
@@ -13,6 +13,7 @@ from testzeus_cli.utils.formatters import format_output, print_message
|
|
|
13
13
|
from testzeus_cli.utils.validators import validate_id, parse_key_value_pairs
|
|
14
14
|
from testzeus_cli.utils.auth import initialize_client_with_token
|
|
15
15
|
from testzeus_cli.utils.files import match_stored_file
|
|
16
|
+
from testzeus_cli.utils.links import print_platform_link
|
|
16
17
|
from pocketbase.client import FileUpload
|
|
17
18
|
|
|
18
19
|
console = Console()
|
|
@@ -28,7 +29,7 @@ def hypermind_code_blocks_group():
|
|
|
28
29
|
@click.option(
|
|
29
30
|
"--filters", "-f", multiple=True, help="Filter results (format: key=value)"
|
|
30
31
|
)
|
|
31
|
-
@click.option("--sort", help="Sort by field")
|
|
32
|
+
@click.option("--sort", default="-updated", show_default=True, help="Sort by field")
|
|
32
33
|
@click.option("--expand", help="Expand related entities")
|
|
33
34
|
@click.pass_context
|
|
34
35
|
def list_hypermind_code_blocks(ctx, filters, sort, expand):
|
|
@@ -54,6 +55,7 @@ def list_hypermind_code_blocks(ctx, filters, sort, expand):
|
|
|
54
55
|
return code_blocks
|
|
55
56
|
|
|
56
57
|
result = asyncio.run(_run())
|
|
58
|
+
print_platform_link(ctx, "hypermind-code-blocks")
|
|
57
59
|
format_output(result, ctx.obj["FORMAT"])
|
|
58
60
|
|
|
59
61
|
|
|
@@ -83,6 +85,7 @@ def get_hypermind_code_block(ctx, code_block_id, expand):
|
|
|
83
85
|
return code_block.data
|
|
84
86
|
|
|
85
87
|
result = asyncio.run(_run())
|
|
88
|
+
print_platform_link(ctx, "hypermind-code-blocks")
|
|
86
89
|
format_output(result, ctx.obj["FORMAT"])
|
|
87
90
|
|
|
88
91
|
|
|
@@ -10,6 +10,7 @@ from testzeus_cli.config import get_client_config
|
|
|
10
10
|
from testzeus_cli.utils.formatters import format_output, print_message
|
|
11
11
|
from testzeus_cli.utils.auth import initialize_client_with_token
|
|
12
12
|
from testzeus_cli.utils.validators import parse_key_value_pairs, validate_id
|
|
13
|
+
from testzeus_cli.utils.links import print_platform_link
|
|
13
14
|
|
|
14
15
|
console = Console()
|
|
15
16
|
|
|
@@ -24,7 +25,7 @@ def knowledge_bases_group():
|
|
|
24
25
|
@click.option(
|
|
25
26
|
"--filters", "-f", multiple=True, help="Filter results (format: key=value)"
|
|
26
27
|
)
|
|
27
|
-
@click.option("--sort", help="Sort by field")
|
|
28
|
+
@click.option("--sort", default="-updated", show_default=True, help="Sort by field")
|
|
28
29
|
@click.option("--expand", help="Expand related entities")
|
|
29
30
|
@click.pass_context
|
|
30
31
|
def list(ctx, filters, sort, expand):
|
|
@@ -51,6 +52,7 @@ def list(ctx, filters, sort, expand):
|
|
|
51
52
|
|
|
52
53
|
try:
|
|
53
54
|
result = asyncio.run(_run())
|
|
55
|
+
print_platform_link(ctx, "integrations/knowledge-base")
|
|
54
56
|
format_output(result, ctx.obj["FORMAT"])
|
|
55
57
|
except Exception as e:
|
|
56
58
|
print_message(f"[red]Error listing knowledge bases: {str(e)}[/red]", ctx.obj["FORMAT"])
|
|
@@ -81,6 +83,7 @@ def get_kb(ctx, kb_id, expand):
|
|
|
81
83
|
|
|
82
84
|
try:
|
|
83
85
|
result = asyncio.run(_run())
|
|
86
|
+
print_platform_link(ctx, "integrations/knowledge-base")
|
|
84
87
|
format_output(result, ctx.obj["FORMAT"])
|
|
85
88
|
except Exception as e:
|
|
86
89
|
print_message(f"[red]Error getting knowledge base: {str(e)}[/red]", ctx.obj["FORMAT"])
|
|
@@ -26,7 +26,7 @@ def notification_channels_group():
|
|
|
26
26
|
@click.option(
|
|
27
27
|
"--filters", "-f", multiple=True, help="Filter results (format: key=value)"
|
|
28
28
|
)
|
|
29
|
-
@click.option("--sort", help="Sort by field")
|
|
29
|
+
@click.option("--sort", default="-updated", show_default=True, help="Sort by field")
|
|
30
30
|
@click.option("--expand", help="Expand related entities (comma-separated)")
|
|
31
31
|
@click.option("--page", default=1, help="Page number")
|
|
32
32
|
@click.option("--per-page", default=50, help="Items per page")
|
|
@@ -10,6 +10,7 @@ from testzeus_cli.config import get_client_config
|
|
|
10
10
|
from testzeus_cli.utils.formatters import format_output, print_message
|
|
11
11
|
from testzeus_cli.utils.auth import initialize_client_with_token
|
|
12
12
|
from testzeus_cli.utils.validators import parse_key_value_pairs, validate_id, validate_tenant_ownership
|
|
13
|
+
from testzeus_cli.utils.links import print_platform_link
|
|
13
14
|
|
|
14
15
|
console = Console()
|
|
15
16
|
|
|
@@ -59,7 +60,7 @@ def create(ctx, name, value):
|
|
|
59
60
|
@click.option(
|
|
60
61
|
"--filters", "-f", multiple=True, help="Filter results (format: key=value)"
|
|
61
62
|
)
|
|
62
|
-
@click.option("--sort", help="Sort by field")
|
|
63
|
+
@click.option("--sort", default="-updated", show_default=True, help="Sort by field")
|
|
63
64
|
@click.option("--expand", help="Expand related entities")
|
|
64
65
|
@click.pass_context
|
|
65
66
|
def list(ctx, filters, sort, expand):
|
|
@@ -86,6 +87,7 @@ def list(ctx, filters, sort, expand):
|
|
|
86
87
|
|
|
87
88
|
try:
|
|
88
89
|
result = asyncio.run(_run())
|
|
90
|
+
print_platform_link(ctx, "tags")
|
|
89
91
|
format_output(result, ctx.obj["FORMAT"])
|
|
90
92
|
except Exception as e:
|
|
91
93
|
print_message(f"[red]Error listing tags: {str(e)}[/red]", ctx.obj["FORMAT"])
|
|
@@ -116,6 +118,7 @@ def get_tags(ctx, tag_id, expand):
|
|
|
116
118
|
|
|
117
119
|
try:
|
|
118
120
|
result = asyncio.run(_run())
|
|
121
|
+
print_platform_link(ctx, "tags")
|
|
119
122
|
format_output(result, ctx.obj["FORMAT"])
|
|
120
123
|
except Exception as e:
|
|
121
124
|
print_message(f"[red]Error getting tag: {str(e)}[/red]", ctx.obj["FORMAT"])
|
|
@@ -15,6 +15,7 @@ from testzeus_cli.utils.formatters import format_output, print_message
|
|
|
15
15
|
from testzeus_cli.utils.validators import validate_id, validate_tenant_ownership, parse_key_value_pairs
|
|
16
16
|
from testzeus_cli.utils.auth import initialize_client_with_token
|
|
17
17
|
from testzeus_cli.utils.files import match_stored_file
|
|
18
|
+
from testzeus_cli.utils.links import print_platform_link
|
|
18
19
|
from pocketbase.client import FileUpload
|
|
19
20
|
|
|
20
21
|
console = Console()
|
|
@@ -60,7 +61,7 @@ def test_data_group():
|
|
|
60
61
|
@click.option(
|
|
61
62
|
"--filters", "-f", multiple=True, help="Filter results (format: key=value)"
|
|
62
63
|
)
|
|
63
|
-
@click.option("--sort", help="Sort by field")
|
|
64
|
+
@click.option("--sort", default="-updated", show_default=True, help="Sort by field")
|
|
64
65
|
@click.option("--expand", help="Expand related entities")
|
|
65
66
|
@click.pass_context
|
|
66
67
|
def list_test_data(ctx, filters, sort, expand):
|
|
@@ -86,6 +87,7 @@ def list_test_data(ctx, filters, sort, expand):
|
|
|
86
87
|
return test_data
|
|
87
88
|
|
|
88
89
|
result = asyncio.run(_run())
|
|
90
|
+
print_platform_link(ctx, "test-data")
|
|
89
91
|
format_output(result, ctx.obj["FORMAT"])
|
|
90
92
|
|
|
91
93
|
|
|
@@ -115,15 +117,12 @@ def get_test_data(ctx, test_data_id, expand):
|
|
|
115
117
|
return test_data.data
|
|
116
118
|
|
|
117
119
|
result = asyncio.run(_run())
|
|
120
|
+
print_platform_link(ctx, "test-data")
|
|
118
121
|
format_output(result, ctx.obj["FORMAT"])
|
|
119
122
|
|
|
120
123
|
|
|
121
124
|
@test_data_group.command(name="create")
|
|
122
125
|
@click.option("--name", required=True, help="Test data name")
|
|
123
|
-
@click.option("--type", default="test", help="Test data type")
|
|
124
|
-
@click.option(
|
|
125
|
-
"--status", default="draft", help="Test data status (draft, ready, deleted)"
|
|
126
|
-
)
|
|
127
126
|
@click.option("--data", "-d", help=DATA_FORMAT_HELP)
|
|
128
127
|
@click.option(
|
|
129
128
|
"--data-file",
|
|
@@ -138,7 +137,7 @@ def get_test_data(ctx, test_data_id, expand):
|
|
|
138
137
|
help="Path to supporting data file to upload",
|
|
139
138
|
)
|
|
140
139
|
@click.pass_context
|
|
141
|
-
def create_test_data(ctx, name,
|
|
140
|
+
def create_test_data(ctx, name, data, data_file, file):
|
|
142
141
|
"""Create new test data"""
|
|
143
142
|
|
|
144
143
|
if not data and not data_file:
|
|
@@ -158,8 +157,7 @@ def create_test_data(ctx, name, type, status, data, data_file, file):
|
|
|
158
157
|
|
|
159
158
|
test_data = {
|
|
160
159
|
"name": name,
|
|
161
|
-
"type":
|
|
162
|
-
"status": status,
|
|
160
|
+
"type": "test",
|
|
163
161
|
"data": data_content,
|
|
164
162
|
"tenant": tenant_id,
|
|
165
163
|
"modified_by": user_id,
|
|
@@ -193,8 +191,6 @@ def create_test_data(ctx, name, type, status, data, data_file, file):
|
|
|
193
191
|
@test_data_group.command(name="update")
|
|
194
192
|
@click.argument("test_data_id")
|
|
195
193
|
@click.option("--name", help="New test data name")
|
|
196
|
-
@click.option("--type", help="New test data type")
|
|
197
|
-
@click.option("--status", help="New test data status (draft, ready, deleted)")
|
|
198
194
|
@click.option("--data", "-d", help=DATA_FORMAT_HELP)
|
|
199
195
|
@click.option(
|
|
200
196
|
"--data-file",
|
|
@@ -209,7 +205,7 @@ def create_test_data(ctx, name, type, status, data, data_file, file):
|
|
|
209
205
|
help="Path to supporting data file to upload",
|
|
210
206
|
)
|
|
211
207
|
@click.pass_context
|
|
212
|
-
def update_test_data(ctx, test_data_id, name,
|
|
208
|
+
def update_test_data(ctx, test_data_id, name, data, data_file, file):
|
|
213
209
|
"""Update an existing test data"""
|
|
214
210
|
|
|
215
211
|
if data and data_file:
|
|
@@ -250,14 +246,6 @@ def update_test_data(ctx, test_data_id, name, type, status, data, data_file, fil
|
|
|
250
246
|
updates["name"] = name
|
|
251
247
|
has_updates = True
|
|
252
248
|
|
|
253
|
-
if type:
|
|
254
|
-
updates["type"] = type
|
|
255
|
-
has_updates = True
|
|
256
|
-
|
|
257
|
-
if status:
|
|
258
|
-
updates["status"] = status
|
|
259
|
-
has_updates = True
|
|
260
|
-
|
|
261
249
|
# Process input data (either from input or file)
|
|
262
250
|
if data_content:
|
|
263
251
|
updates["data"] = data_content
|
|
@@ -12,6 +12,7 @@ from testzeus_cli.config import get_client_config
|
|
|
12
12
|
from testzeus_cli.utils.formatters import format_output, print_message
|
|
13
13
|
from testzeus_cli.utils.validators import validate_id, validate_tenant_ownership, parse_key_value_pairs
|
|
14
14
|
from testzeus_cli.utils.auth import initialize_client_with_token
|
|
15
|
+
from testzeus_cli.utils.links import print_platform_link
|
|
15
16
|
|
|
16
17
|
console = Console()
|
|
17
18
|
|
|
@@ -26,7 +27,7 @@ def test_report_schedules_group():
|
|
|
26
27
|
@click.option(
|
|
27
28
|
"--filters", "-f", multiple=True, help="Filter results (format: key=value)"
|
|
28
29
|
)
|
|
29
|
-
@click.option("--sort", help="Sort by field")
|
|
30
|
+
@click.option("--sort", default="-updated", show_default=True, help="Sort by field")
|
|
30
31
|
@click.option("--expand", help="Expand related entities (comma-separated)")
|
|
31
32
|
@click.option("--page", default=1, help="Page number")
|
|
32
33
|
@click.option("--per-page", default=50, help="Items per page")
|
|
@@ -54,6 +55,7 @@ def list_schedules(ctx, filters, sort, expand, page, per_page):
|
|
|
54
55
|
return schedules
|
|
55
56
|
|
|
56
57
|
result = asyncio.run(_run())
|
|
58
|
+
print_platform_link(ctx, "report-scheduler")
|
|
57
59
|
format_output(result, ctx.obj["FORMAT"])
|
|
58
60
|
|
|
59
61
|
|
|
@@ -84,6 +86,7 @@ def get_schedule(ctx, schedule_id, expand):
|
|
|
84
86
|
return schedule.data
|
|
85
87
|
|
|
86
88
|
result = asyncio.run(_run())
|
|
89
|
+
print_platform_link(ctx, "report-scheduler")
|
|
87
90
|
format_output(result, ctx.obj["FORMAT"])
|
|
88
91
|
|
|
89
92
|
|
|
@@ -13,6 +13,7 @@ from testzeus_cli.config import get_client_config
|
|
|
13
13
|
from testzeus_cli.utils.formatters import format_output, print_message
|
|
14
14
|
from testzeus_cli.utils.validators import validate_id, validate_tenant_ownership, parse_key_value_pairs
|
|
15
15
|
from testzeus_cli.utils.auth import initialize_client_with_token
|
|
16
|
+
from testzeus_cli.utils.links import print_platform_link
|
|
16
17
|
|
|
17
18
|
console = Console()
|
|
18
19
|
|
|
@@ -27,7 +28,7 @@ def test_run_groups_group():
|
|
|
27
28
|
@click.option(
|
|
28
29
|
"--filters", "-f", multiple=True, help="Filter results (format: key=value)"
|
|
29
30
|
)
|
|
30
|
-
@click.option("--sort", help="Sort by field")
|
|
31
|
+
@click.option("--sort", default="-updated", show_default=True, help="Sort by field")
|
|
31
32
|
@click.option("--expand", help="Expand related entities (comma-separated)")
|
|
32
33
|
@click.option("--page", default=1, help="Page number")
|
|
33
34
|
@click.option("--per-page", default=50, help="Items per page")
|
|
@@ -377,6 +378,7 @@ def download_test_run_group_report(ctx, test_run_group_id, output_dir, report_fo
|
|
|
377
378
|
|
|
378
379
|
try:
|
|
379
380
|
result = asyncio.run(_run())
|
|
381
|
+
print_platform_link(ctx, "reports")
|
|
380
382
|
if result["success"]:
|
|
381
383
|
print_message(
|
|
382
384
|
f"[green]Report downloaded successfully to: {result['file_path']}[/green]",
|