build: false
services:
  - postgresql
  - mongodb
  - mysql

environment:
  matrix:
    - PYTHON: "C:/Python35"
    - PYTHON: "C:/Python36"
    - PYTHON: "C:/Python37"

  # postgres
  POSTGRES_PATH: C:\Program Files\PostgreSQL\9.4
  PGUSER: postgres
  PGPASSWORD: Password12!

  MYSQL_ENV_MYSQL_USER: root
  MYSQL_ENV_MYSQL_PASSWORD: Password12!
  MYSQL_ENV_MYSQL_DATABASE: sqlectron
  MYSQL_PATH: C:\Program Files\MySql\MySQL Server 5.7
  MYSQL_PWD: Password12!
  MONGOPATH: C:/mongodb

init:
  - "ECHO %PYTHON%"
  - ps: "ls C:/Python*"
  - SET PATH=%MONGOPATH\bin%;%MYSQL_PATH\bin%;%POSTGRES_PATH%\bin;%MYSQL_PATH%\bin;%PATH%

install:
  - "%PYTHON%/Scripts/pip.exe install -e ."
  - "%PYTHON%/Scripts/pip.exe install -r test_requirements.txt"
  - "%PYTHON%/Scripts/pip.exe install -r requirements.txt"

test_script:
  - C:/mongodb/bin/mongo.exe pwmantest tests/init_mongo.js
  - psql -c "CREATE USER tester WITH PASSWORD '123456';"
  - psql -c "create database pwman"
  - psql -c "grant ALL ON DATABASE pwman to tester"
  - mysql -e "create database pwmantest" -uroot
  - mysql -e "create user 'pwman'@'localhost' IDENTIFIED BY '123456'" -uroot
  - mysql -e "grant all on pwmantest.* to 'pwman'@'localhost';" -uroot
  - "%PYTHON%/Scripts/pip.exe --version"
  - "%PYTHON%/python.exe setup.py test"

