LionsAd / drupal_ti

Drupal - Travis Integration
82 stars 37 forks source link

DRUPAL_TI_DB is required even though already present in DRUPAL_TI_DB_URL. #65

Open kenorb opened 8 years ago

kenorb commented 8 years ago

DRUPAL_TI_DB is required even though already present in DRUPAL_TI_DB_URL.

In addition to that travis can create a DB itself, too, now.

Original report

I've got the following error in this build:

$ drupal-ti before_script
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Error: /home/travis/.composer/vendor/lionsad/drupal_ti/runners/simpletest/before_script.sh exited with a failure.

My .travis.yml file.

Installed via: composer global require -n --prefer-source lionsad/drupal_ti:1.*

LionsAd commented 8 years ago

Thank you for the bug report.

Could you enable debugging and do a test run again, then send me a travis link?

https://github.com/drupal-modules/rules_forms/blob/02e419ba0764e306de8508fbddfacd0e44a55358/.travis.yml#L55

I presume something goes wrong in drush or drupal installation, but hard to tell without debugging.

I only see that tests are still passing on master, so it must be somehow related to your code base, too.

kenorb commented 8 years ago

Ok, my DRUPAL_TI_DB was missing, so drupal.sh failed to create the database via:

mysql -e "create database $DRUPAL_TI_DB"

I thought specifying DRUPAL_TI_DB_URL should be enough, but it seems we need both DRUPAL_TI_DB and DRUPAL_TI_DB_URL.

Isn't database should be present automatically by the following Travis lines?

mysql:
  database: drupal
  username: root
  encoding: utf8

What about if I'd like to test with PostgreSQL?

LionsAd commented 8 years ago

Yes, we need both. It might be the code was based on an earlier travis version.

We likely could fix it by just gaining the DB from the DB URL.

I don't think there is any use case, where those should not be matching.

LionsAd commented 8 years ago

I always copy the .dist file into new projects, so likely missed that there was redundant information in there.

Thanks!