charisma-cli 0.6.1__tar.gz → 0.6.2__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.
Files changed (39) hide show
  1. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/PKG-INFO +1 -1
  2. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/pyproject.toml +1 -1
  3. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/src/charisma_cli/__init__.py +1 -1
  4. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/src/charisma_cli/main.py +6 -2
  5. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/src/charisma_cli/models.py +6 -0
  6. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/src/charisma_cli/uploader.py +13 -13
  7. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_silent_mode.py +9 -7
  8. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/.gitignore +0 -0
  9. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/README.md +0 -0
  10. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/src/charisma_cli/config.py +0 -0
  11. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/src/charisma_cli/launch_url.py +0 -0
  12. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/src/charisma_cli/parser.py +0 -0
  13. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/src/charisma_cli/read_client.py +0 -0
  14. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/src/charisma_cli/read_models.py +0 -0
  15. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/src/charisma_cli/retry.py +0 -0
  16. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/src/charisma_cli/subprocess_mgr.py +0 -0
  17. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/src/charisma_cli/watcher.py +0 -0
  18. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/__init__.py +0 -0
  19. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/conftest.py +0 -0
  20. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_bamboo_labels.py +0 -0
  21. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_cli.py +0 -0
  22. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_config.py +0 -0
  23. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_integration.py +0 -0
  24. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_launch_url.py +0 -0
  25. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_models.py +0 -0
  26. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_open_launch_payload.py +0 -0
  27. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_parser.py +0 -0
  28. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_read_client.py +0 -0
  29. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_read_client_attachments.py +0 -0
  30. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_read_client_integration.py +0 -0
  31. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_read_client_launches.py +0 -0
  32. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_read_client_pagination.py +0 -0
  33. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_read_client_results.py +0 -0
  34. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_read_client_single_result.py +0 -0
  35. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_retry.py +0 -0
  36. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_subprocess_mgr.py +0 -0
  37. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_testplan_cmd.py +0 -0
  38. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_uploader.py +0 -0
  39. {charisma_cli-0.6.1 → charisma_cli-0.6.2}/tests/test_watcher.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: charisma-cli
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Summary: CLI tool that watches allure-results and streams test results + attachments to Charisma.
5
5
  Author: Charisma Team
6
6
  License-Expression: MIT
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
5
5
 
6
6
  [project]
7
7
  name = "charisma-cli"
8
- version = "0.6.1"
8
+ version = "0.6.2"
9
9
  description = "CLI tool that watches allure-results and streams test results + attachments to Charisma."
10
10
  readme = "README.md"
11
11
  license = "MIT"
@@ -4,4 +4,4 @@
4
4
  # is generated from pyproject.toml [project].version, so keeping this literal
5
5
  # equal to pyproject guarantees `--version` reports the published version. The
6
6
  # prepare-commit step owns the PATCH bump — do not hand-bump here.
7
- __version__ = "0.6.1"
7
+ __version__ = "0.6.2"
@@ -27,6 +27,8 @@ from charisma_cli.watcher import ResultsWatcher, classify_file
27
27
  # land well past 15s — a too-short window is the watch results_sent=0 bug.
28
28
  SETTLE_QUIET_PERIOD = 2.0
29
29
  SETTLE_MAX_WAIT = 60.0
30
+ # Cap on file names in the --silent skip warning, so a mass skip can't flood the log.
31
+ _MAX_SKIPPED_NAMES = 10
30
32
 
31
33
 
32
34
  @click.group()
@@ -142,9 +144,11 @@ def _print_summary(uploader: Uploader, config: Config) -> None:
142
144
  """Print the upload summary to stdout; under --silent also flag skips on stderr."""
143
145
  summary = uploader.summary
144
146
  if config.silent and summary.attachments_skipped:
147
+ names = summary.skipped_attachment_names
148
+ more = f" and {len(names) - _MAX_SKIPPED_NAMES} more" if len(names) > _MAX_SKIPPED_NAMES else ""
145
149
  click.echo(
146
- f"Warning: {summary.attachments_skipped} attachment(s) skipped; "
147
- "rerun without --silent to see which.",
150
+ f"Warning: {summary.attachments_skipped} attachment(s) skipped: "
151
+ f"{', '.join(names[:_MAX_SKIPPED_NAMES])}{more}",
148
152
  err=True,
149
153
  )
150
154
  click.echo(
@@ -163,3 +163,9 @@ class UploadSummary:
163
163
  attachments_sent: int = 0
164
164
  attachments_skipped: int = 0
165
165
  containers_sent: int = 0
166
+ skipped_attachment_names: list[str] = field(default_factory=list)
167
+
168
+ def record_attachment_skip(self, name: str) -> None:
169
+ """Count a skipped attachment and keep its name for the --silent summary."""
170
+ self.attachments_skipped += 1
171
+ self.skipped_attachment_names.append(name)
@@ -780,7 +780,7 @@ class Uploader:
780
780
  than being immediately counted as skipped.
781
781
  """
782
782
  if not self._launch_id or not path.exists():
783
- self._summary.attachments_skipped += 1
783
+ self._summary.record_attachment_skip(path.name)
784
784
  return
785
785
 
786
786
  result_id = self._resolve_result_id(path.name)
@@ -838,7 +838,7 @@ class Uploader:
838
838
  """
839
839
  self._retry_pending_attachments()
840
840
  for path in self._pending_attachments:
841
- self._summary.attachments_skipped += 1
841
+ self._summary.record_attachment_skip(path.name)
842
842
  logger.warning("Skipping attachment with no matching result: %s", path.name)
843
843
  self._pending_attachments = []
844
844
 
@@ -861,7 +861,7 @@ class Uploader:
861
861
  try:
862
862
  content = path.read_bytes()
863
863
  except OSError as e:
864
- self._summary.attachments_skipped += 1
864
+ self._summary.record_attachment_skip(path.name)
865
865
  logger.warning("Cannot read attachment %s: %s", path.name, e)
866
866
  return
867
867
 
@@ -917,7 +917,7 @@ class Uploader:
917
917
  Allure name).
918
918
  """
919
919
  if self._client is None or not self._launch_id:
920
- self._summary.attachments_skipped += 1
920
+ self._summary.record_attachment_skip(filename)
921
921
  logger.warning("Cannot upload attachment %s: no open launch", filename)
922
922
  return
923
923
 
@@ -964,7 +964,7 @@ class Uploader:
964
964
  time.sleep(exponential_backoff(attempt))
965
965
  continue
966
966
  # Non-retryable status (e.g. 404) or retries exhausted.
967
- self._summary.attachments_skipped += 1
967
+ self._summary.record_attachment_skip(filename)
968
968
  logger.warning(
969
969
  "Attachment upload failed: HTTP %d for %s",
970
970
  response.status_code,
@@ -975,7 +975,7 @@ class Uploader:
975
975
  if attempt < MAX_RETRIES:
976
976
  time.sleep(exponential_backoff(attempt))
977
977
  continue
978
- self._summary.attachments_skipped += 1
978
+ self._summary.record_attachment_skip(filename)
979
979
  logger.warning(
980
980
  "Attachment upload failed after %d retries: %s for %s",
981
981
  MAX_RETRIES,
@@ -985,7 +985,7 @@ class Uploader:
985
985
  return
986
986
  except Exception:
987
987
  # Non-network error (e.g. malformed client state) — not retryable.
988
- self._summary.attachments_skipped += 1
988
+ self._summary.record_attachment_skip(filename)
989
989
  logger.warning("Attachment upload unexpected error for %s", filename, exc_info=True)
990
990
  return
991
991
 
@@ -1027,7 +1027,7 @@ class Uploader:
1027
1027
  if attempt < MAX_RETRIES:
1028
1028
  time.sleep(exponential_backoff(attempt))
1029
1029
  continue
1030
- self._summary.attachments_skipped += 1
1030
+ self._summary.record_attachment_skip(filename)
1031
1031
  logger.warning(
1032
1032
  "Attachment %s step failed after %d retries: %s for %s",
1033
1033
  describe,
@@ -1096,7 +1096,7 @@ class Uploader:
1096
1096
  if presign_resp is None:
1097
1097
  return
1098
1098
  if presign_resp.status_code != 201:
1099
- self._summary.attachments_skipped += 1
1099
+ self._summary.record_attachment_skip(filename)
1100
1100
  logger.warning(
1101
1101
  "Attachment presign failed: HTTP %d for %s",
1102
1102
  presign_resp.status_code,
@@ -1110,7 +1110,7 @@ class Uploader:
1110
1110
  attachment_id = presign_data["attachmentId"]
1111
1111
  s3_key = presign_data["s3Key"]
1112
1112
  except (ValueError, json.JSONDecodeError, KeyError, TypeError):
1113
- self._summary.attachments_skipped += 1
1113
+ self._summary.record_attachment_skip(filename)
1114
1114
  logger.warning("Attachment presign returned a malformed body for %s", filename)
1115
1115
  return
1116
1116
 
@@ -1129,7 +1129,7 @@ class Uploader:
1129
1129
  if put_resp is None:
1130
1130
  return
1131
1131
  if put_resp.status_code not in (200, 201):
1132
- self._summary.attachments_skipped += 1
1132
+ self._summary.record_attachment_skip(filename)
1133
1133
  logger.warning(
1134
1134
  "Attachment S3 PUT failed: HTTP %d for %s",
1135
1135
  put_resp.status_code,
@@ -1159,7 +1159,7 @@ class Uploader:
1159
1159
  if complete_resp.status_code == 201:
1160
1160
  self._summary.attachments_sent += 1
1161
1161
  return
1162
- self._summary.attachments_skipped += 1
1162
+ self._summary.record_attachment_skip(filename)
1163
1163
  logger.warning(
1164
1164
  "Attachment complete failed: HTTP %d for %s",
1165
1165
  complete_resp.status_code,
@@ -1182,7 +1182,7 @@ class Uploader:
1182
1182
  for filename, content, history_id in spills:
1183
1183
  result_id = self._result_id_by_history.get(history_id, "")
1184
1184
  if not result_id:
1185
- self._summary.attachments_skipped += 1
1185
+ self._summary.record_attachment_skip(filename)
1186
1186
  logger.warning(
1187
1187
  "Skipping spill attachment %s: owning result %s was not accepted",
1188
1188
  filename,
@@ -219,14 +219,16 @@ class TestLaunchLifecycle:
219
219
 
220
220
 
221
221
  @pytest.mark.parametrize(("silent", "skipped", "warns"), [(True, 2, True), (True, 0, False), (False, 2, False)])
222
- def test_silent_summary_warns_on_stderr_only_for_skips(capsys, silent: bool, skipped: int, warns: bool) -> None:
223
- """--silent still flags skipped attachments on stderr."""
222
+ def test_silent_summary_names_skipped_files_on_stderr(capsys, silent: bool, skipped: int, warns: bool) -> None:
223
+ """--silent still names skipped attachments on stderr."""
224
224
  from types import SimpleNamespace
225
225
 
226
226
  from charisma_cli.main import _print_summary
227
227
 
228
- uploader = SimpleNamespace(
229
- summary=UploadSummary(attachments_skipped=skipped)
230
- )
231
- _print_summary(uploader, _make_config(silent=silent))
232
- assert ("skipped" in capsys.readouterr().err) is warns
228
+ summary = UploadSummary()
229
+ for i in range(skipped):
230
+ summary.record_attachment_skip(f"shot{i}.png")
231
+ _print_summary(SimpleNamespace(summary=summary), _make_config(silent=silent))
232
+ err = capsys.readouterr().err
233
+ assert ("shot0.png" in err and "shot1.png" in err) is warns
234
+ assert summary.attachments_skipped == skipped
File without changes
File without changes