-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(typeorm): cleanup adapter testing files (#10833)
- Loading branch information
Showing
10 changed files
with
77 additions
and
87 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
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,13 +1,39 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
echo "Waiting 5s for db to start..." | ||
sleep 5 | ||
# Init MySQL container | ||
echo "Initializing container for MySQL tests" | ||
|
||
MYSQL_DATABASE=next-auth | ||
MYSQL_ROOT_PASSWORD=password | ||
MYSQL_CONTAINER_NAME=next-auth-mysql-test | ||
|
||
function startDatabase { | ||
docker run -d --rm \ | ||
-e MYSQL_DATABASE=${MYSQL_DATABASE} \ | ||
-e MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} \ | ||
--name "${MYSQL_CONTAINER_NAME}" \ | ||
-p 3306:3306 \ | ||
mysql:8 --default-authentication-plugin=mysql_native_password | ||
|
||
echo "Waiting 5s for db to start..." | ||
sleep 5 | ||
} | ||
|
||
startDatabase | ||
echo "Started running MySQL tests with default models." | ||
vitest run -c ../utils/vitest.config.ts mysql/index.test.ts | ||
if vitest run -c ../utils/vitest.config.ts mysql/index.test.ts; then | ||
docker stop ${MYSQL_CONTAINER_NAME} | ||
else | ||
docker stop ${MYSQL_CONTAINER_NAME} && exit 1 | ||
fi | ||
echo "Finished running MySQL tests with default models." | ||
|
||
startDatabase | ||
echo "Started running MySQL tests with custom models." | ||
CUSTOM_MODEL=1 vitest run -c ../utils/vitest.config.ts mysql/index.custom.test.ts | ||
if CUSTOM_MODEL=1 vitest run -c ../utils/vitest.config.ts mysql/index.custom.test.ts; then | ||
docker stop ${MYSQL_CONTAINER_NAME} | ||
else | ||
docker stop ${MYSQL_CONTAINER_NAME} && exit 1 | ||
fi | ||
echo "Finished running MySQL tests with custom models." |
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 |
---|---|---|
@@ -1,13 +1,40 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
echo "Waiting 5s for db to start..." | ||
sleep 5 | ||
# Init PostgreSQL container | ||
echo "Initializing container for PostgreSQL tests" | ||
|
||
PGUSER=nextauth | ||
PGDATABASE=nextauth | ||
PG_CONTAINER_NAME=next-auth-postgres-test | ||
|
||
function startDatabase { | ||
docker run -d --rm \ | ||
-e POSTGRES_USER=${PGUSER} \ | ||
-e POSTGRES_DB=${PGDATABASE} \ | ||
-e POSTGRES_HOST_AUTH_METHOD=trust \ | ||
--name "${PG_CONTAINER_NAME}" \ | ||
-p 5432:5432 \ | ||
postgres:13.3 | ||
|
||
echo "Waiting 5s for db to start..." | ||
sleep 5 | ||
} | ||
|
||
startDatabase | ||
echo "Started running PostgreSQL tests with default models." | ||
vitest run -c ../utils/vitest.config.ts postgresql/index.test.ts | ||
if vitest run -c ../utils/vitest.config.ts postgresql/index.test.ts; then | ||
docker stop ${PG_CONTAINER_NAME} | ||
else | ||
docker stop ${PG_CONTAINER_NAME} && exit 1 | ||
fi | ||
echo "Finished running PostgreSQL tests with default models." | ||
|
||
startDatabase | ||
echo "Started running PostgreSQL tests with custom models." | ||
CUSTOM_MODEL=1 vitest run -c ../utils/vitest.config.ts postgresql/index.custom.test.ts | ||
if CUSTOM_MODEL=1 vitest run -c ../utils/vitest.config.ts postgresql/index.custom.test.ts; then | ||
docker stop ${PG_CONTAINER_NAME} | ||
else | ||
docker stop ${PG_CONTAINER_NAME} && exit 1 | ||
fi | ||
echo "Finished running PostgreSQL tests with custom models." |
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 was deleted.
Oops, something went wrong.