forked from github/copilot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·49 lines (39 loc) · 1.15 KB
/
test.sh
File metadata and controls
executable file
·49 lines (39 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# Test script for Go SDK (when Go is available)
set -e
echo "=== Testing Go SDK ==="
echo
# Check prerequisites
if ! command -v go &> /dev/null; then
echo "❌ Go is not installed. Please install Go 1.24 or later."
echo " Visit: https://golang.org/dl/"
exit 1
fi
# Determine COPILOT_CLI_PATH
if [ -z "$COPILOT_CLI_PATH" ]; then
# Try to find it relative to the SDK
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
POTENTIAL_PATH="$SCRIPT_DIR/../nodejs/node_modules/@github/copilot/index.js"
if [ -f "$POTENTIAL_PATH" ]; then
export COPILOT_CLI_PATH="$POTENTIAL_PATH"
echo "📍 Auto-detected CLI path: $COPILOT_CLI_PATH"
else
echo "❌ COPILOT_CLI_PATH environment variable not set"
echo " Run: export COPILOT_CLI_PATH=/path/to/dist-cli/index.js"
exit 1
fi
fi
if [ ! -f "$COPILOT_CLI_PATH" ]; then
echo "❌ CLI not found at: $COPILOT_CLI_PATH"
exit 1
fi
echo "✅ Go version: $(go version)"
echo "✅ CLI path: $COPILOT_CLI_PATH"
echo
# Run Go tests
cd "$(dirname "$0")"
echo "=== Running Go SDK E2E Tests ==="
echo
go test -v ./... -race
echo
echo "✅ All tests passed!"