forked from hunyadi/pysqlsync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_test.sh
executable file
·37 lines (33 loc) · 1.39 KB
/
run_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
set -e
# PostgreSQL and MySQL
TEST_INTEGRATION=1 TEST_POSTGRESQL=1 TEST_MYSQL=1 python3 -m unittest discover
# MySQL
# CONTAINER=mysql-db
# docker ps -q --filter "name=$CONTAINER" | xargs -r docker stop
# docker ps -aq --filter "name=$CONTAINER" | xargs -r docker rm
# docker run -d --name $CONTAINER -p 3306:3306 -e "MYSQL_ROOT_PASSWORD=<?YourStrong@Passw0rd>" -e MYSQL_DATABASE=levente_hunyadi mysql:8.0
# sleep 30
# TEST_INTEGRATION=1 TEST_MYSQL=1 python3 -m unittest discover
# docker stop $CONTAINER && docker rm $CONTAINER
# Oracle
CONTAINER=oracle-db
docker ps -q --filter "name=$CONTAINER" | xargs -r docker stop
docker ps -aq --filter "name=$CONTAINER" | xargs -r docker rm
docker run -d \
-e "ORACLE_PWD=<?YourStrong@Passw0rd>" \
-p 1521:1521 \
--name $CONTAINER container-registry.oracle.com/database/free:latest
sleep 30
TEST_INTEGRATION=1 TEST_ORACLE=1 python3 -m unittest discover
docker stop $CONTAINER && docker rm $CONTAINER
# Microsoft SQL Server
CONTAINER=sql1
docker ps -q --filter "name=$CONTAINER" | xargs -r docker stop
docker ps -aq --filter "name=$CONTAINER" | xargs -r docker rm
docker run -d \
-e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=<?YourStrong@Passw0rd>" \
--hostname sql1 -p 1433:1433 \
--name $CONTAINER mcr.microsoft.com/mssql/server:2022-latest
sleep 30
TEST_INTEGRATION=1 TEST_MSSQL=1 python3 -m unittest discover
docker stop $CONTAINER && docker rm $CONTAINER