You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: move sse-test-client into testing-tools crate
Reorganize sse-test-client into a testing-tools crate to support future
testing utilities. This provides a unified location for all testing tools
while maintaining the existing sse-test-client binary functionality.
Changes:
- Create testing-tools crate with library structure
- Move sse-test-client source to testing-tools/src/
- Relocate main.rs to testing-tools/src/bin/sse-test-client.rs
- Add lib.rs to export shared modules
- Update workspace Cargo.toml to reference testing-tools instead of sse-test-client
- Update README with new crate structure and usage commands
- Preserve binary name and functionality (cargo run -p testing-tools --bin sse-test-client)
The binary remains fully functional and all documentation has been updated
to reflect the new package structure.
Copy file name to clipboardExpand all lines: testing-tools/README.md
+27-22Lines changed: 27 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,12 @@
1
-
# SSE Test Client
1
+
# Testing Tools
2
+
3
+
A collection of testing utilities and tools for the Refactor Platform.
4
+
5
+
## SSE Test Client
2
6
3
7
A standalone Rust binary for testing Server-Sent Events (SSE) functionality without requiring a frontend client. The tool authenticates as two users, establishes SSE connections, triggers events via API calls, and validates that events are received correctly.
4
8
5
-
## Overview
9
+
###Overview
6
10
7
11
This tool validates the SSE infrastructure by:
8
12
1. Authenticating two users (typically a coach and coachee)
@@ -11,48 +15,48 @@ This tool validates the SSE infrastructure by:
11
15
4. Triggering events (create/update/delete actions, force logout)
12
16
5. Verifying that the correct SSE events are received by the appropriate users
13
17
14
-
## Prerequisites
18
+
###Prerequisites
15
19
16
20
- Backend server running (default: `http://localhost:4000`)
17
21
- Two valid user accounts with credentials (seeded users recommended)
18
22
-**For action tests**: An existing coaching relationship between the users (will be created if it doesn't exist)
19
23
-**For connection test**: No special permissions or relationships required
20
24
21
-
## Usage
25
+
###Usage
22
26
23
27
### Run Individual Test Scenarios
24
28
25
29
```bash
26
30
# Test basic SSE connection (no admin permissions required)
27
-
cargo run -p sse-test-client -- \
31
+
cargo run -p testing-tools --bin sse-test-client -- \
28
32
--base-url http://localhost:4000 \
29
33
--user1 "james.hodapp@gmail.com:password" \
30
34
--user2 "calebbourg2@gmail.com:password" \
31
35
--scenario connection-test
32
36
33
37
# Test action creation (requires admin permissions)
34
-
cargo run -p sse-test-client -- \
38
+
cargo run -p testing-tools --bin sse-test-client -- \
35
39
--base-url http://localhost:4000 \
36
40
--user1 "james.hodapp@gmail.com:password" \
37
41
--user2 "calebbourg2@gmail.com:password" \
38
42
--scenario action-create
39
43
40
44
# Test action update (requires admin permissions)
41
-
cargo run -p sse-test-client -- \
45
+
cargo run -p testing-tools --bin sse-test-client -- \
42
46
--base-url http://localhost:4000 \
43
47
--user1 "james.hodapp@gmail.com:password" \
44
48
--user2 "calebbourg2@gmail.com:password" \
45
49
--scenario action-update
46
50
47
51
# Test action delete (requires admin permissions)
48
-
cargo run -p sse-test-client -- \
52
+
cargo run -p testing-tools --bin sse-test-client -- \
49
53
--base-url http://localhost:4000 \
50
54
--user1 "james.hodapp@gmail.com:password" \
51
55
--user2 "calebbourg2@gmail.com:password" \
52
56
--scenario action-delete
53
57
54
58
# Test force logout (requires admin permissions - NOT YET IMPLEMENTED)
55
-
cargo run -p sse-test-client -- \
59
+
cargo run -p testing-tools --bin sse-test-client -- \
56
60
--base-url http://localhost:4000 \
57
61
--user1 "james.hodapp@gmail.com:password" \
58
62
--user2 "calebbourg2@gmail.com:password" \
@@ -62,7 +66,7 @@ cargo run -p sse-test-client -- \
62
66
### Run All Tests
63
67
64
68
```bash
65
-
cargo run -p sse-test-client -- \
69
+
cargo run -p testing-tools --bin sse-test-client -- \
66
70
--base-url http://localhost:4000 \
67
71
--user1 "james.hodapp@gmail.com:password" \
68
72
--user2 "calebbourg2@gmail.com:password" \
@@ -72,15 +76,15 @@ cargo run -p sse-test-client -- \
72
76
### Enable Verbose Logging
73
77
74
78
```bash
75
-
cargo run -p sse-test-client -- \
79
+
cargo run -p testing-tools --bin sse-test-client -- \
76
80
--base-url http://localhost:4000 \
77
81
--user1 "james.hodapp@gmail.com:password" \
78
82
--user2 "calebbourg2@gmail.com:password" \
79
83
--scenario all \
80
84
--verbose
81
85
```
82
86
83
-
## Available Scenarios
87
+
###Available Scenarios
84
88
85
89
-`connection-test` - Tests basic SSE connectivity without creating any data
86
90
-`action-create` - Tests SSE events for action creation (uses existing coaching relationship or creates one)
@@ -89,7 +93,7 @@ cargo run -p sse-test-client -- \
89
93
-`force-logout-test` - Tests SSE events for force logout (NOT YET IMPLEMENTED)
90
94
-`all` - Runs all test scenarios sequentially
91
95
92
-
## Command-Line Arguments
96
+
###Command-Line Arguments
93
97
94
98
| Argument | Required | Description |
95
99
|----------|----------|-------------|
@@ -99,7 +103,7 @@ cargo run -p sse-test-client -- \
99
103
|`--scenario`| Yes | Test scenario to run (see Available Scenarios) |
100
104
|`--verbose` or `-v`| No | Enable verbose output with debug logging |
101
105
102
-
## How It Works
106
+
###How It Works
103
107
104
108
### Setup Phase
105
109
1. Authenticates both users and obtains session cookies
@@ -118,7 +122,7 @@ For each scenario:
118
122
- Shows pass/fail status with durations
119
123
- Exits with code 0 if all tests pass, 1 if any fail
120
124
121
-
## Example Output
125
+
###Example Output
122
126
123
127
### Connection Test (No Admin Required)
124
128
```
@@ -194,11 +198,12 @@ Results: 1 passed, 0 failed
194
198
All tests passed! ✓
195
199
```
196
200
197
-
## Module Structure
201
+
###Module Structure
198
202
199
-
-`main.rs` - CLI entry point and scenario orchestration
200
-
-`auth.rs` - User authentication and session management
201
-
-`sse_client.rs` - SSE connection handling and event listening
202
-
-`api_client.rs` - API calls to create test data and trigger events
0 commit comments