File tree 1 file changed +9
-15
lines changed
packages/adapter-postgres/src/__tests__
1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -56,29 +56,23 @@ if [ ! -f "$SCHEMA_PATH" ]; then
56
56
exit 1
57
57
fi
58
58
59
- $DOCKER_COMPOSE_CMD -f docker-compose.test.yml exec -T postgres-test psql -U postgres -d eliza_test -f - < " $SCHEMA_PATH "
60
- if [ $? -ne 0 ] ; then
59
+ # Fix: Check exit code directly instead of using $?
60
+ if ! $DOCKER_COMPOSE_CMD -f docker-compose.test.yml exec -T postgres-test psql -U postgres -d eliza_test -f - < " $SCHEMA_PATH " ; then
61
61
echo -e " ${RED} Failed to load schema${NC} "
62
62
exit 1
63
63
fi
64
64
echo -e " ${GREEN} Schema loaded successfully!${NC} "
65
65
66
66
# Run the tests
67
67
echo -e " ${YELLOW} Running tests...${NC} "
68
- pnpm vitest vector-extension.test.ts
68
+ if ! pnpm vitest vector-extension.test.ts; then
69
+ echo -e " ${RED} Tests failed!${NC} "
70
+ $DOCKER_COMPOSE_CMD -f docker-compose.test.yml down
71
+ exit 1
72
+ fi
69
73
70
- # Capture test exit code
71
- TEST_EXIT_CODE=$?
74
+ echo -e " ${GREEN} Tests completed successfully!${NC} "
72
75
73
76
# Clean up
74
77
echo -e " ${YELLOW} Cleaning up test environment...${NC} "
75
- $DOCKER_COMPOSE_CMD -f docker-compose.test.yml down
76
-
77
- # Exit with test exit code
78
- if [ $TEST_EXIT_CODE -eq 0 ]; then
79
- echo -e " ${GREEN} Tests completed successfully!${NC} "
80
- else
81
- echo -e " ${RED} Tests failed!${NC} "
82
- fi
83
-
84
- exit $TEST_EXIT_CODE
78
+ $DOCKER_COMPOSE_CMD -f docker-compose.test.yml down
You can’t perform that action at this time.
0 commit comments