Skip to content

Fix 1757#1758

Merged
oberstet merged 3 commits intocrossbario:masterfrom
oberstet:fix_1757
Nov 10, 2025
Merged

Fix 1757#1758
oberstet merged 3 commits intocrossbario:masterfrom
oberstet:fix_1757

Conversation

@oberstet
Copy link
Contributor

@oberstet oberstet commented Nov 10, 2025

Description

Please explain the changes you are proposing.


Related Issue(s)

Closes or relates to #1757


Checklist

  • I have referenced relevant issue numbers above
  • I have performed a self-review of my code and it follows
    the style guidelines of this project
  • I have added new or used existing tests that prove my fix
    is effective or that my feature works
  • I have added necessary documentation (if appropriate) and
    updated the changelog
  • I have added an AI assistance disclosure file (required!)
    in this PR

Fixes crossbario#1757

time.clock() was removed in Python 3.8 in favor of time.perf_counter().
This commit updates the slowsquare RPC examples to use the modern API.

Changes:
- examples/twisted/wamp/rpc/slowsquare/frontend.py: 3 replacements
- examples/asyncio/wamp/rpc/slowsquare/frontend.py: 3 replacements

time.perf_counter() provides a monotonic clock with the best available
resolution for measuring performance, which is the intended behavior
for timing RPC call durations.

Tested with: just test-integration-ab-examples from crossbar repository
Add detailed test result reporting with categorization:

- Individual example results with ✓/✗ symbols
- Aggregation by backend (twisted/asyncio) with pass/fail counts
- Aggregation by WAMP feature (overview/pubsub/rpc) with pass/fail counts
- Color-coded output (green for pass, red for fail)
- Overall summary with total test counts

New functions:
- categorize_example(): Parse example paths to determine backend and feature type
- print_summary(): Display comprehensive test results with categorization

Benefits:
- Better visibility into test coverage
- Easy identification of failures by category
- Clear summary statistics for CI/CD integration

Fixes crossbario#1757
@oberstet
Copy link
Contributor Author

test output looks like nicer now:

========================================================================
Crossbar Integration Test: Autobahn|Python Examples
========================================================================
Crossbar venv: cpy311
Autobahn|Python path: /home/user/work/wamp/autobahn-python

✓ Found run-all-examples.py and router configuration

========================================================================
Test 1: RawSocket Transport (rs://127.0.0.1:8080)
========================================================================
Note: run-all-examples.py starts its own crossbar instance

[... individual example execution output ...]

================================================================================
Test Results Summary
================================================================================

Individual Examples:
--------------------------------------------------------------------------------
✓ twisted  overview ./twisted/wamp/overview
✓ twisted  pubsub   ./twisted/wamp/pubsub/basic/
✓ twisted  pubsub   ./twisted/wamp/pubsub/complex/
✓ twisted  pubsub   ./twisted/wamp/pubsub/decorators/
✓ twisted  pubsub   ./twisted/wamp/pubsub/options/
✓ twisted  pubsub   ./twisted/wamp/pubsub/unsubscribe/
✓ twisted  rpc      ./twisted/wamp/rpc/timeservice/
✓ twisted  rpc      ./twisted/wamp/rpc/slowsquare/
✓ twisted  rpc      ./twisted/wamp/rpc/progress/
✓ twisted  rpc      ./twisted/wamp/rpc/options/
✓ twisted  rpc      ./twisted/wamp/rpc/errors/
✓ twisted  rpc      ./twisted/wamp/rpc/decorators/
✓ twisted  rpc      ./twisted/wamp/rpc/complex/
✓ twisted  rpc      ./twisted/wamp/rpc/arguments/
✓ asyncio  overview ./asyncio/wamp/overview
✓ asyncio  pubsub   ./asyncio/wamp/pubsub/unsubscribe/
✓ asyncio  pubsub   ./asyncio/wamp/pubsub/options/
✓ asyncio  pubsub   ./asyncio/wamp/pubsub/decorators/
✓ asyncio  pubsub   ./asyncio/wamp/pubsub/complex/
✓ asyncio  pubsub   ./asyncio/wamp/pubsub/basic/
✓ asyncio  rpc      ./asyncio/wamp/rpc/timeservice/
✓ asyncio  rpc      ./asyncio/wamp/rpc/slowsquare/
✓ asyncio  rpc      ./asyncio/wamp/rpc/progress/
✓ asyncio  rpc      ./asyncio/wamp/rpc/options/
✓ asyncio  rpc      ./asyncio/wamp/rpc/errors/
✓ asyncio  rpc      ./asyncio/wamp/rpc/decorators/
✓ asyncio  rpc      ./asyncio/wamp/rpc/complex/
✓ asyncio  rpc      ./asyncio/wamp/rpc/arguments/

By Backend:
--------------------------------------------------------------------------------
✓ twisted : 14/14 passed, 0 failed
✓ asyncio : 14/14 passed, 0 failed

By WAMP Feature:
--------------------------------------------------------------------------------
✓ overview: 2/2 passed, 0 failed
✓ pubsub  : 10/10 passed, 0 failed
✓ rpc     : 16/16 passed, 0 failed

================================================================================
✓ ALL TESTS PASSED
 Total: 28/28 examples completed successfully
================================================================================

✓ RawSocket transport tests passed

========================================================================
Test 2: WebSocket Transport (ws://127.0.0.1:8080/ws)
========================================================================
Note: run-all-examples.py starts its own crossbar instance

[... similar detailed output for WebSocket transport ...]

✓ WebSocket transport tests passed

========================================================================
Summary
========================================================================
✅ ALL INTEGRATION TESTS PASSED
  - RawSocket transport: PASS
  - WebSocket transport: PASS

@oberstet oberstet merged commit e3b37f1 into crossbario:master Nov 10, 2025
30 checks passed
@oberstet oberstet deleted the fix_1757 branch November 10, 2025 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant