Commit 1ed686d6 authored by Remi Collin's avatar Remi Collin

Fix travis

parents ea064548 9d5398b1
sudo: required
dist: trusty
language: php language: php
php: php:
- 7.1 - "7.2"
- 7.2 - "7.1"
env:
global:
- DRIVER_VERSION="stable"
- ADAPTER_VERSION="^1.0.0"
sudo: true
services: services:
- mongodb - docker
- mysql
install:
matrix: # Update docker-engine using Ubuntu 'trusty' apt repo
fast_finish: true - >
include: curl -sSL "https://get.docker.com/gpg" |
- php: 7.1 sudo -E apt-key add -
addons: - >
apt: echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" |
sources: sudo tee -a /etc/apt/sources.list
- sourceline: "deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" - sudo apt-get update
key_url: "https://www.mongodb.org/static/pgp/server-3.4.asc" - >
- "mongodb-upstart" sudo apt-get -o Dpkg::Options::="--force-confdef" \
packages: ['mongodb-org-server'] -o Dpkg::Options::="--force-confold" --assume-yes install docker-engine --allow-unauthenticated
- php: 7.2 - docker version
addons:
apt: # Update docker-compose via pip
sources: - sudo pip install docker-compose
- sourceline: "deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" - docker-compose version
key_url: "https://www.mongodb.org/static/pgp/server-3.4.asc" - docker-compose up --build -d
- "mongodb-upstart" - docker ps -a
packages: ['mongodb-org-server']
before_script:
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then pecl install -f mongodb-${DRIVER_VERSION}; fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then composer config "platform.ext-mongo" "1.6.16" && composer require "alcaeus/mongo-php-adapter=${ADAPTER_VERSION}"; fi
- mysql -e 'create database unittest;'
- service mongod start
- travis_retry composer self-update
- travis_retry composer install --no-interaction
script: script:
- mkdir -p build/logs - docker-compose up --exit-code-from php
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml
after_success:
- sh -c 'php vendor/bin/coveralls -v'
...@@ -3,6 +3,7 @@ version: '3' ...@@ -3,6 +3,7 @@ version: '3'
services: services:
php: php:
container_name: php
build: build:
context: . context: .
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
...@@ -15,6 +16,7 @@ services: ...@@ -15,6 +16,7 @@ services:
- mongodb - mongodb
mysql: mysql:
container_name: mysql
image: mysql image: mysql
environment: environment:
MYSQL_ROOT_PASSWORD: MYSQL_ROOT_PASSWORD:
...@@ -24,6 +26,7 @@ services: ...@@ -24,6 +26,7 @@ services:
driver: none driver: none
mongodb: mongodb:
container_name: mongodb
image: mongo image: mongo
logging: logging:
driver: none driver: none
FROM php:7.1-cli FROM php:7.1-cli
RUN pecl install xdebug
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y autoconf pkg-config libssl-dev && \ apt-get install -y autoconf pkg-config libssl-dev git && \
pecl install mongodb && docker-php-ext-enable mongodb && \ pecl install mongodb git zlib1g-dev && docker-php-ext-enable mongodb && \
docker-php-ext-install -j$(nproc) pdo pdo_mysql docker-php-ext-install -j$(nproc) pdo pdo_mysql zip && docker-php-ext-enable xdebug
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/ \
&& ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
ENV PATH="~/.composer/vendor/bin:./vendor/bin:${PATH}"
\ No newline at end of file
#!/usr/bin/env bash #!/usr/bin/env bash
sleep 3 && php ./vendor/bin/phpunit sleep 3 && composer install --prefer-source --no-interaction && php ./vendor/bin/phpunit
...@@ -117,7 +117,7 @@ class MongoQueue extends DatabaseQueue ...@@ -117,7 +117,7 @@ class MongoQueue extends DatabaseQueue
})->get(); })->get();
foreach ($reserved as $job) { foreach ($reserved as $job) {
$attempts = $job['attempts']; $attempts = $job['attempts'] + 1;
$this->releaseJob($job['_id'], $attempts); $this->releaseJob($job['_id'], $attempts);
} }
} }
......
...@@ -96,6 +96,18 @@ class Builder extends \Illuminate\Database\Schema\Builder ...@@ -96,6 +96,18 @@ class Builder extends \Illuminate\Database\Schema\Builder
} }
} }
/**
* @inheritdoc
*/
public function dropIfExists($collection)
{
if ($this->hasCollection($collection)) {
return $this->drop($collection);
}
return false;
}
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment