-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- `make test` now works whether you are inside or outside the docker container - tests now better handle errors that cause the `actual` psql variable to be unset - fail if no tests were run
- Loading branch information
Showing
8 changed files
with
395 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,35 +8,12 @@ if [ -f .env ]; then | |
set +a | ||
fi | ||
|
||
if [ -z "$ENABLE_OPENAI_TESTS" ]; then | ||
export ENABLE_OPENAI_TESTS=0 | ||
if [ -n "$WHERE_AM_I" ] && [ "$WHERE_AM_I" == "docker" ]; then | ||
if [ "$(whoami)" == "root" ]; then | ||
echo switching to postgres user... | ||
su postgres - | ||
fi | ||
psql -d postgres -f test.sql | ||
else | ||
psql --no-psqlrc -d 'postgres://[email protected]:9876/postgres' -f test.sql | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.