-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy path.travis.yml
105 lines (99 loc) · 4.11 KB
/
.travis.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
sudo: true
language: c
before_install:
- export MAIN_PATH=`pwd`
# install pyenv to test multiple python version
- |-
if [ "$TRAVIS_OS_NAME" == "windows" ] ; then
choco install pyenv-win
export PYENV_ROOT=$HOME/.pyenv
export PATH=$PYENV_ROOT/pyenv-win/bin:$PYENV_ROOT/pyenv-win/shims:$PATH
pyenv update
else
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
fi
# install c dependency
- |-
if [ "$TRAVIS_OS_NAME" == "linux" ] ; then
sudo apt-get install software-properties-common
sudo apt-get install -f libssl-dev libssl1.1
sudo apt-get install -f
fi
- git clone https://github.com/mariadb-corporation/mariadb-connector-c.git ~/.cc_3
- cd ~/.cc_3
- mkdir bld
- cd bld
- |-
case $TRAVIS_OS_NAME in
windows)
export WIX="c:/Program Files (x86)/WiX Toolset v3.14"
export MARIADB_CC_INSTALL_DIR=$HOME/conc
cmake .. -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$MARIADB_CC_INSTALL_DIR
cmake --build . --config RelWithDebInfo
cmake --install . --config RelWithDebInfo
;;
osx)
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_EXTERNAL_ZLIB:BOOL=ON -DOPENSSL_ROOT_DIR=/usr/local/opt/[email protected]
make -j4
;;
linux)
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make -j4
;;
esac
- |-
if [ "$TRAVIS_OS_NAME" != "windows" ] ; then
sudo make install
export MARIADB_PLUGIN_DIR==`mariadb_config --plugindir`
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/mariadb
else
export MARIADB_PLUGIN_DIR=$MARIADB_CC_INSTALL/lib/mariadb/plugin
fi
# install "install-latest" to retrieve latest python version corresponding to major.minor version
- git clone https://github.com/momo-lab/pyenv-install-latest.git $PYENV_ROOT/plugins/pyenv-install-latest
- export REAL_PYTHON_VERSION=$(pyenv install --list | grep --extended-regexp "^\s*[0-9][0-9.]*[0-9]\s*$" | tail -1 | tr -d ' ')
- echo $REAL_PYTHON_VERSION
- pyenv install $REAL_PYTHON_VERSION
- export PYENV_VERSION=$REAL_PYTHON_VERSION
- pyenv versions
# install server
- cd $MAIN_PATH
env:
global: PYTHON_VER="3.10" HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 DB=testp CLEAR_TEXT=0
import: mariadb-corporation/connector-test-machine:common-build.yml@master
jobs:
include:
- stage: Language
env: srv=mariadb v=10.11 local=1 PYTHON_VER="3.9"
name: "Python 3.9"
- env: srv=mariadb v=10.11 local=1 PYTHON_VER="3.10"
name: "Python 3.10"
- env: srv=mariadb v=10.11 local=1 PYTHON_VER="3.11"
name: "Python 3.11"
- env: srv=mariadb v=10.11 local=1 PYTHON_VER="3.12"
name: "Python 3.12"
- env: srv=mariadb v=10.11 local=1 PYTHON_VER="3.13"
name: "Python 3.13"
script:
- python --version
- python -m pip install .
# - python setup.py build
# - python setup.py install
- cd testing
- |-
if [ -z "$BENCH" ] ; then
python -m unittest discover -v
else
pip install mysql-connector-python pymysql pyperf
export TEST_MODULE=mariadb
python bench_init.py --inherit-environ=TEST_MODULE,TEST_DB_USER,TEST_DB_HOST,TEST_DB_DATABASE,TEST_DB_PORT,TEST_REQUIRE_TLS,TEST_DB_PASSWORD --copy-env
python bench.py -o mariadb_bench.json --inherit-environ=TEST_MODULE,TEST_DB_USER,TEST_DB_HOST,TEST_DB_DATABASE,TEST_DB_PORT,TEST_REQUIRE_TLS,TEST_DB_PASSWORD --copy-env
export TEST_MODULE=mysql.connector
python bench.py -o mysql-connector-python_bench.json --inherit-environ=TEST_MODULE,TEST_DB_USER,TEST_DB_HOST,TEST_DB_DATABASE,TEST_DB_PORT,TEST_REQUIRE_TLS,TEST_DB_PASSWORD --copy-env
export TEST_MODULE=pymysql
python bench.py -o pymysql_bench.json --inherit-environ=TEST_MODULE,TEST_DB_USER,TEST_DB_HOST,TEST_DB_DATABASE,TEST_DB_PORT,TEST_REQUIRE_TLS,TEST_DB_PASSWORD --copy-env
python -m pyperf compare_to pymysql_bench.json mysql-connector-python_bench.json mariadb_bench.json --table
fi