Repository navigation
Expand file tree
/
Copy pathrun-integration-tests.sh
More file actions
executable file
·96 lines (82 loc) · 3.44 KB
/
Copy pathrun-integration-tests.sh
File metadata and controls
executable file
·96 lines (82 loc) · 3.44 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/sh
# Script to run integration tests for sttp-ai library
# Usage:
# ANTHROPIC_API_KEY=... OPENAI_API_KEY=... ./run-integration-tests.sh
#
# Or set the OPENAI_API_KEY and ANTHROPIC_API_KEY environment variables and run:
# ./run-integration-tests.sh
#
# Or create a .env file with the API keys and run:
# ./run-integration-tests.sh
set -e
# Check if .env file exists and source it
if [ -f ".env" ]; then
echo "Reading API keys from .env file"
while read -r line; do
line="$(echo "${line%%#*}" | xargs)"
[ -n "$line" ] && export "$line"
done < .env
fi
# Check which API keys are available
OPENAI_SET=false
ANTHROPIC_SET=false
GEMINI_SET=false
AZURE_SET=false
GEMINI_VERTEX_SET=false
JEV_SET=false
if [ -n "${OPENAI_API_KEY}" ]; then
OPENAI_SET=true
echo "✓ OPENAI_API_KEY is set"
else
echo "⚠️ OPENAI_API_KEY is not set - OpenAI tests will be skipped"
fi
if [ -n "${ANTHROPIC_API_KEY}" ]; then
ANTHROPIC_SET=true
echo "✓ ANTHROPIC_API_KEY is set"
else
echo "⚠️ ANTHROPIC_API_KEY is not set - Claude tests will be skipped"
fi
if [ -n "${GEMINI_API_KEY}" ]; then
GEMINI_SET=true
echo "✓ GEMINI_API_KEY is set"
else
echo "⚠️ GEMINI_API_KEY is not set - Gemini tests will be skipped"
fi
if [ -n "${GEMINI_VERTEX_PROJECT}" ] && [ -n "${GEMINI_VERTEX_ACCESS_TOKEN}" ]; then
GEMINI_VERTEX_SET=true
echo "✓ GEMINI_VERTEX_PROJECT and GEMINI_VERTEX_ACCESS_TOKEN are set"
else
echo "⚠️ GEMINI_VERTEX_PROJECT/GEMINI_VERTEX_ACCESS_TOKEN are not set - Gemini on Vertex AI tests will be skipped"
fi
if [ -n "${AZURE_OPENAI_API_KEY}" ] && [ -n "${AZURE_OPENAI_ENDPOINT}" ]; then
AZURE_SET=true
echo "✓ AZURE_OPENAI_API_KEY and AZURE_OPENAI_ENDPOINT are set"
else
echo "⚠️ AZURE_OPENAI_API_KEY/AZURE_OPENAI_ENDPOINT are not set - Azure OpenAI tests will be skipped"
fi
if [ -n "${TYPESAFE_API_KEY}" ] || [ -n "${JEV_API_KEY}" ]; then
JEV_SET=true
echo "✓ TYPESAFE_API_KEY / JEV_API_KEY is set"
else
echo "⚠️ TYPESAFE_API_KEY / JEV_API_KEY is not set - Jev tests will be skipped"
fi
if [ "$OPENAI_SET" = false ] && [ "$ANTHROPIC_SET" = false ] && [ "$GEMINI_SET" = false ] && [ "$GEMINI_VERTEX_SET" = false ] && [ "$AZURE_SET" = false ] && [ "$JEV_SET" = false ]; then
echo ""
echo "Usage:"
echo " 1. Create .env file with OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, TYPESAFE_API_KEY and AZURE_OPENAI_API_KEY/AZURE_OPENAI_ENDPOINT"
echo " 2. Or set environment variables: export OPENAI_API_KEY=... ANTHROPIC_API_KEY=... GEMINI_API_KEY=... TYPESAFE_API_KEY=... AZURE_OPENAI_API_KEY=... AZURE_OPENAI_ENDPOINT=..."
echo " 3. Or pass OpenAI key as argument: ./run-integration-tests.sh your-key-here"
echo ""
echo "📝 Note: Without API keys, all integration tests will be skipped (not failed)"
exit 0
fi
echo ""
echo "🧪 Running integration tests..."
# Run the integration tests (including agent tests)
sbt "testOnly *OpenAIIntegrationSpec *ClaudeIntegrationSpec *GeminiIntegrationSpec *GeminiVertexIntegrationSpec *JevIntegrationSpec *AzureOpenAIIntegrationSpec *OpenAIAgentIntegrationSpec *ClaudeAgentIntegrationSpec *GeminiAgentIntegrationSpec"
echo ""
if [ "$OPENAI_SET" = true ] || [ "$ANTHROPIC_SET" = true ] || [ "$GEMINI_SET" = true ] || [ "$GEMINI_VERTEX_SET" = true ] || [ "$AZURE_SET" = true ] || [ "$JEV_SET" = true ]; then
echo "✅ Integration tests completed!"
else
echo "✅ Integration tests skipped (no API keys provided)"
fi