[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

sqlalchemy testsuite


Here are some notes about running the sqlalchemy test suite on jessie.
The document leaves a lot of the setup up to the user.
I still have some failures with MySQL and Unicode, even when configuring
everything in utf8...

I'm aggregating test suite notes at https://wiki.debian.org/LTS/TestSuites

# Base doc in README.unittests.rst

apt install python-pytest python-mock python-setuptools python-dev
python-mysqldb python-psycopg2
# python-pysqlite1.1 python-pysqlite2 # -> replaced by built-in sqlite3

# sqlite tests
apt install python-nose
./sqla_nose.py -v --write-profiles
# Ran 6054 tests in 123.179s
# OK (SKIP=198)

# sqlite tests
python setup.py test
# 5939 passed, 727 skipped in 157.86 seconds

# more DBs
apt install mysql-server
sed -i -e 's/\[mysqld\]/[mysqld]\ndefault_storage_engine=MyISAM/'
/etc/mysql/my.cnf # -> documented but doesn't change test results
#sed -i -e 's/\[mysqld\]/[mysqld]\ncharacter_set_server=utf8/'
/etc/mysql/my.cnf # -> doesn't change test results (still 4
unicode-related failures)
service mysql restart
mysql -e "DROP DATABASE test;"
mysql -e "DROP DATABASE test_schema;"
mysql -e "CREATE DATABASE test;"
mysql -e "CREATE DATABASE test_schema;"
mysql -e "GRANT ALL PRIVILEGES ON test.* TO 'scott'@'localhost'
mysql -e "GRANT ALL PRIVILEGES ON test_schema.* TO 'scott'@'localhost'
apt install postgresql
echo 'max_prepared_transactions = 100' >>
sed -i -e 's/^lc_.*/#&/' /etc/postgresql/9.4/main/postgresql.conf
service postgresql restart
echo -e 'tiger\ntiger' | su - postgres -c 'createuser scott -l -P'
su - postgres -c 'dropdb test'
su - postgres -c 'createdb test'
#su - postgres -c "psql -c 'GRANT ALL PRIVILEGES ON DATABASE test to scott;'
su - postgres -c "psql -c 'CREATE SCHEMA test_schema AUTHORIZATION
scott;' test"
su - postgres -c "psql -c 'CREATE SCHEMA test_schema_2 AUTHORIZATION
scott;' test"
su - postgres -c 'psql -c "ALTER DATABASE test SET
default_text_search_config = '\''pg_catalog.english'\'';"'
py.test --db sqlite --db postgresql --db mysql
# Note: apparently one needs to drop/recreate the pgsql DBs due to some
test leftovers

# MySQL: py.test --db mysql
# 4 failed, 5967 passed, 695 skipped in 288.81 seconds
# PostgreSQL: py.test --db postgresql
# 6354 passed, 312 skipped in 333.16 seconds
# All: py.test --db sqlite --db postgresql --db mysql
# 4 failed, 8904 passed, 341 skipped in 312.66 seconds

Reply to: