Closed kitsook closed 4 years ago
With MySQL 5.7.5, the sql_mode ONLY_FULL_GROUP_BY
is set. This breaks some iPeer queries.
For now, will add the followings to .travis.yml
so test cases can run:
# disable ONLY_FULL_GROUP_BY... otherwise some iPeer queries will fail
- mysql -e "SELECT @@sql_mode;" -uroot
- mysql -e "SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));" -uroot
- mysql -e "SELECT @@sql_mode;" -uroot
In long run, needs to revise those queries. The way iPeer uses group
to find distinct values is not complying to SQL standard.
Take extra precautions when upgrade database.
Unit tests run fine with docker images but failing on Travis CI. Last successful execution was a few months ago.
Last successful run: https://travis-ci.org/ubc/iPeer/builds/539427352
Failed run: https://travis-ci.org/ubc/iPeer/builds/559198094
Comparing the diff between the two commits (
eefb413
vsfc4620a
) doesn't show any reason why the test cases are failing. The CI env is diff though. The PHP is installed differently and is of an older version with recent runs.The issue seems to be related to
group
option in CakePHP data retrieval. Using this option seems to cause thefind
function returns nothing. e.g. commenting this out will make the Course model tests pass on CI:https://github.com/ubc/iPeer/blob/53bbb6290d88d4e684d49766f16b39963c8ae2aa/app/models/course.php#L483-L486