mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
more rust stuff to purge
This commit is contained in:
parent
7e2b20f4bc
commit
1519fbca16
2 changed files with 14 additions and 33 deletions
|
|
@ -113,10 +113,10 @@ struct SessionIdHandlingTests {
|
||||||
|
|
||||||
// MARK: - Session List Parsing Tests
|
// MARK: - Session List Parsing Tests
|
||||||
|
|
||||||
@Test("Parse tty-fwd session list response")
|
@Test("Parse session list response")
|
||||||
func testParseTtyFwdSessionList() throws {
|
func testParseSessionList() throws {
|
||||||
// Define a local type for parsing tty-fwd session JSON
|
// Define a local type for parsing session JSON
|
||||||
struct TtyFwdSession: Codable {
|
struct Session: Codable {
|
||||||
let cmdline: [String]
|
let cmdline: [String]
|
||||||
let cwd: String
|
let cwd: String
|
||||||
let name: String
|
let name: String
|
||||||
|
|
@ -127,8 +127,8 @@ struct SessionIdHandlingTests {
|
||||||
let streamOut: String
|
let streamOut: String
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test parsing the JSON response from tty-fwd --list-sessions
|
// Test parsing the JSON response from session list
|
||||||
let ttyFwdResponse = """
|
let sessionResponse = """
|
||||||
{
|
{
|
||||||
"a37ea008-41f6-412f-bbba-f28f091267ce": {
|
"a37ea008-41f6-412f-bbba-f28f091267ce": {
|
||||||
"cmdline": ["zsh"],
|
"cmdline": ["zsh"],
|
||||||
|
|
@ -143,8 +143,8 @@ struct SessionIdHandlingTests {
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
let data = ttyFwdResponse.data(using: .utf8)!
|
let data = sessionResponse.data(using: .utf8)!
|
||||||
let sessions = try JSONDecoder().decode([String: TtyFwdSession].self, from: data)
|
let sessions = try JSONDecoder().decode([String: Session].self, from: data)
|
||||||
|
|
||||||
// Verify the session ID is a proper UUID
|
// Verify the session ID is a proper UUID
|
||||||
#expect(sessions.count == 1)
|
#expect(sessions.count == 1)
|
||||||
|
|
@ -163,15 +163,14 @@ struct SessionIdHandlingTests {
|
||||||
@Test(.bug("https://github.com/example/issues/123"))
|
@Test(.bug("https://github.com/example/issues/123"))
|
||||||
func testSessionIdMismatchBugFixed() async throws {
|
func testSessionIdMismatchBugFixed() async throws {
|
||||||
// This test documents the specific bug that was fixed:
|
// This test documents the specific bug that was fixed:
|
||||||
// 1. Swift server generated: "session_1234567890_abc123"
|
// 1. Server generated session ID
|
||||||
// 2. tty-fwd generated: "a37ea008-41f6-412f-bbba-f28f091267ce"
|
// 2. Client used the session ID for operations
|
||||||
// 3. Client used Swift's ID for input: /api/sessions/session_1234567890_abc123/input
|
// 3. Session lookup must work correctly with the generated ID
|
||||||
// 4. Server looked up session in tty-fwd's list and found nothing → 404
|
|
||||||
|
|
||||||
// The fix ensures:
|
// The fix ensures:
|
||||||
// - Swift server captures tty-fwd's UUID from stdout
|
// - Server generates and manages session IDs
|
||||||
// - Returns that UUID to the client
|
// - Returns the correct ID to the client
|
||||||
// - All subsequent operations use the correct UUID
|
// - All subsequent operations use the correct ID
|
||||||
|
|
||||||
// This test serves as documentation of the bug and its fix
|
// This test serves as documentation of the bug and its fix
|
||||||
// No assertion needed - test passes if it compiles
|
// No assertion needed - test passes if it compiles
|
||||||
|
|
|
||||||
|
|
@ -73,24 +73,6 @@ echo "Code signing: $SIGN_APP"
|
||||||
# Clean build directory only if it doesn't exist
|
# Clean build directory only if it doesn't exist
|
||||||
mkdir -p "$BUILD_DIR"
|
mkdir -p "$BUILD_DIR"
|
||||||
|
|
||||||
# Build tty-fwd universal binary
|
|
||||||
echo "🔨 Building tty-fwd universal binary..."
|
|
||||||
if [[ -x "$PROJECT_DIR/tty-fwd/build-universal.sh" ]]; then
|
|
||||||
cd "$PROJECT_DIR/tty-fwd"
|
|
||||||
./build-universal.sh
|
|
||||||
|
|
||||||
# Verify the binary was built
|
|
||||||
if [[ -f "$PROJECT_DIR/tty-fwd/target/release/tty-fwd-universal" ]]; then
|
|
||||||
echo "✓ tty-fwd universal binary built successfully"
|
|
||||||
# Note: The Xcode build phase will copy this to the app bundle
|
|
||||||
else
|
|
||||||
echo "Error: Failed to build tty-fwd universal binary"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Error: tty-fwd build script not found at $PROJECT_DIR/tty-fwd/build-universal.sh"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Build Go vibetunnel universal binary
|
# Build Go vibetunnel universal binary
|
||||||
echo "🔨 Building Go vibetunnel universal binary..."
|
echo "🔨 Building Go vibetunnel universal binary..."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue