forked from timescale/pgai
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.sh
executable file
·42 lines (33 loc) · 899 Bytes
/
test.sh
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
#!/usr/bin/env bash
set -e
# if a .env file exists, load and export the variables in it
if [ -f .env ]; then
set -a
source .env
set +a
fi
if [ -z "$ENABLE_OPENAI_TESTS" ]; then
export ENABLE_OPENAI_TESTS=0
fi
if [ "$ENABLE_OPENAI_TESTS" ] && [ -z "$OPENAI_API_KEY" ]; then
echo "OPENAI_API_KEY must be set if running OpenAI tests"
exit 3
fi
if [ -z "$ENABLE_OLLAMA_TESTS" ]; then
export ENABLE_OLLAMA_TESTS=0
fi
if [ -z "$ENABLE_ANTHROPIC_TESTS" ]; then
export ENABLE_ANTHROPIC_TESTS=0
fi
if [ "$ENABLE_ANTHROPIC_TESTS" ] && [ -z "$ANTHROPIC_API_KEY" ]; then
echo "ANTHROPIC_API_KEY must be set if running Anthropic tests"
exit 3
fi
if [ -z "$ENABLE_COHERE_TESTS" ]; then
export ENABLE_COHERE_TESTS=0
fi
if [ "$ENABLE_COHERE_TESTS" ] && [ -z "$COHERE_API_KEY" ]; then
echo "COHERE_API_KEY must be set if running Cohere tests"
exit 3
fi
psql -d postgres -f test.sql