fusiontest 0.2.17__tar.gz → 0.2.18__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 (50) hide show
  1. {fusiontest-0.2.17 → fusiontest-0.2.18}/PKG-INFO +1 -1
  2. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/cli.py +38 -3
  3. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest.egg-info/PKG-INFO +1 -1
  4. {fusiontest-0.2.17 → fusiontest-0.2.18}/pyproject.toml +1 -1
  5. {fusiontest-0.2.17 → fusiontest-0.2.18}/README.md +0 -0
  6. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/__init__.py +0 -0
  7. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/bench/__init__.py +0 -0
  8. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/bench/sites/shop/index.html +0 -0
  9. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/bench/suites/shop.yaml +0 -0
  10. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/bench/suites/todomvc.yaml +0 -0
  11. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/core/__init__.py +0 -0
  12. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/core/action_model.py +0 -0
  13. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/core/goal_verifier.py +0 -0
  14. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/core/netguard.py +0 -0
  15. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/core/replay.py +0 -0
  16. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/core/runner.py +0 -0
  17. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/core/screen_parser.py +0 -0
  18. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/core/secrets.py +0 -0
  19. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/core/tokens.py +0 -0
  20. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/demos/__init__.py +0 -0
  21. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/demos/fusiontest_dashboard.yaml +0 -0
  22. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/demos/github.yaml +0 -0
  23. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/demos/hacker_news.yaml +0 -0
  24. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/demos/httpbin.yaml +0 -0
  25. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/demos/todomvc.yaml +0 -0
  26. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/demos/wikipedia.yaml +0 -0
  27. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/desktop/__init__.py +0 -0
  28. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/desktop/macos_adapter.py +0 -0
  29. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/desktop/playwright_adapter.py +0 -0
  30. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/desktop/windows_adapter.py +0 -0
  31. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/discovery/__init__.py +0 -0
  32. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/discovery/goal_generator.py +0 -0
  33. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/guardrails/__init__.py +0 -0
  34. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/guardrails/engine.py +0 -0
  35. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/mobile/__init__.py +0 -0
  36. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/mobile/android_adapter.py +0 -0
  37. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/mobile/ios_adapter.py +0 -0
  38. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/reporting/__init__.py +0 -0
  39. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/reporting/reporter.py +0 -0
  40. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/training/__init__.py +0 -0
  41. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/training/data_collector.py +0 -0
  42. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/training/dataset_builder.py +0 -0
  43. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest/training/trainer.py +0 -0
  44. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest.egg-info/SOURCES.txt +0 -0
  45. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest.egg-info/dependency_links.txt +0 -0
  46. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest.egg-info/entry_points.txt +0 -0
  47. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest.egg-info/not-zip-safe +0 -0
  48. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest.egg-info/requires.txt +0 -0
  49. {fusiontest-0.2.17 → fusiontest-0.2.18}/fusiontest.egg-info/top_level.txt +0 -0
  50. {fusiontest-0.2.17 → fusiontest-0.2.18}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fusiontest
3
- Version: 0.2.17
3
+ Version: 0.2.18
4
4
  Summary: AI-powered UI testing for mobile and desktop — by FusionLeap.io
5
5
  Author-email: FusionLeap <hello@fusionleap.io>
6
6
  License: MIT
@@ -488,9 +488,15 @@ _BACKENDS = ["gpt4o", "claude", "gemini", "groq", "ollama"]
488
488
  help="JSON file recording month-to-date spend (for --monthly-limit)")
489
489
  @click.option("--summary-md", type=click.Path(dir_okay=False), default=None,
490
490
  help="Also write the summary as Markdown (e.g. $GITHUB_STEP_SUMMARY)")
491
+ @click.option("--upload", is_flag=True,
492
+ help="Send results to your FusionTest dashboard (needs FUSIONTEST_API_KEY)")
493
+ @click.option("--source", default="cli", show_default=True,
494
+ help="Label stored with uploaded results, e.g. nightly")
495
+ @click.option("--from-results", "from_results", type=click.Path(exists=True, dir_okay=False),
496
+ default=None, help="Upload an existing results JSON instead of running (implies --upload)")
491
497
  @click.option("--list", "list_suites", is_flag=True, help="List built-in suites")
492
498
  def bench(suites, backends, repeat, headless, out_dir, min_accuracy, max_cost, monthly_limit,
493
- ledger_path, summary_md, list_suites):
499
+ ledger_path, summary_md, upload, source, from_results, list_suites):
494
500
  """Measure how well a backend runs known goals (ADR-008).
495
501
 
496
502
  \b
@@ -514,6 +520,9 @@ def bench(suites, backends, repeat, headless, out_dir, min_accuracy, max_cost, m
514
520
  return
515
521
 
516
522
  _load_env()
523
+ if from_results:
524
+ ok = _upload_bench(json.loads(Path(from_results).read_text()), source)
525
+ sys.exit(0 if ok else 1)
517
526
  try:
518
527
  loaded = [fbench.load_suite(name) for name in (suites or fbench.builtin_suites())]
519
528
  except ValueError as exc:
@@ -611,7 +620,7 @@ def bench(suites, backends, repeat, headless, out_dir, min_accuracy, max_cost, m
611
620
  out.mkdir(parents=True, exist_ok=True)
612
621
  stamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
613
622
  path = out / f"bench-{stamp}.json"
614
- path.write_text(json.dumps({
623
+ results = {
615
624
  "created_at": stamp,
616
625
  "fusiontest_version": _package_version(),
617
626
  "spent_usd": round(spent, 4),
@@ -619,8 +628,11 @@ def bench(suites, backends, repeat, headless, out_dir, min_accuracy, max_cost, m
619
628
  "stopped_for_budget": budget_hit,
620
629
  "summaries": [sm.to_dict() for sm in summaries],
621
630
  "runs": [r.to_dict() for r in runs],
622
- }, indent=2))
631
+ }
632
+ path.write_text(json.dumps(results, indent=2))
623
633
  console.print(f"\n[dim]Results: {path}[/dim]")
634
+ if upload and summaries:
635
+ _upload_bench(results, source)
624
636
  if summary_md:
625
637
  Path(summary_md).write_text(_bench_markdown(summaries, runs, spend_line), encoding="utf-8")
626
638
 
@@ -633,6 +645,29 @@ def bench(suites, backends, repeat, headless, out_dir, min_accuracy, max_cost, m
633
645
  sys.exit(1)
634
646
 
635
647
 
648
+ def _upload_bench(results: dict, source: str) -> bool:
649
+ """POST a bench results dict to /api/bench. Returns True on success."""
650
+ import os
651
+
652
+ import httpx
653
+
654
+ api_key = os.getenv("FUSIONTEST_API_KEY")
655
+ api_url = os.getenv("FUSIONTEST_API_URL", "https://api.fusiontest.fusionleap.io")
656
+ if not api_key:
657
+ console.print("[yellow]Not uploaded:[/yellow] set FUSIONTEST_API_KEY (Dashboard → API Keys).")
658
+ return False
659
+ try:
660
+ resp = httpx.post(f"{api_url}/api/bench/", json={**results, "source": source},
661
+ headers={"Authorization": f"Bearer {api_key}"}, timeout=30)
662
+ resp.raise_for_status()
663
+ except Exception as e: # noqa: BLE001 — uploading must never lose the local results
664
+ console.print(f"[yellow]Warning:[/yellow] Could not upload benchmark results: {e}")
665
+ return False
666
+ console.print("[green]✓[/green] Benchmark results uploaded: "
667
+ "[cyan]https://app.fusiontest.fusionleap.io/benchmarks[/cyan]")
668
+ return True
669
+
670
+
636
671
  def _cost_cell(runs, suite: str, backend: str) -> str:
637
672
  costs = [r.cost_usd for r in runs if r.suite == suite and r.backend == backend]
638
673
  return "—" if any(c is None for c in costs) else f"${sum(costs):.2f}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fusiontest
3
- Version: 0.2.17
3
+ Version: 0.2.18
4
4
  Summary: AI-powered UI testing for mobile and desktop — by FusionLeap.io
5
5
  Author-email: FusionLeap <hello@fusionleap.io>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "fusiontest"
7
- version = "0.2.17"
7
+ version = "0.2.18"
8
8
  description = "AI-powered UI testing for mobile and desktop — by FusionLeap.io"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes