Skip to content

Commit

Permalink
extend processing time for messages (#48)
Browse files Browse the repository at this point in the history
* extend processing time for messages

* remove prefer stable from prefer lowest

* try different hamcrest version for travis composer
  • Loading branch information
Harry Bragg authored May 25, 2018
1 parent 2c948a8 commit c3a6f7f
Show file tree
Hide file tree
Showing 37 changed files with 2,849 additions and 89 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
vendor/
composer.lock

.idea
.DS_Store
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ cache:
- $HOME/.composer/cache/files

php:
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- nightly
- hhvm

env:
- 'COMPOSER_FLAGS="--prefer-lowest --prefer-stable"'
Expand All @@ -22,10 +20,10 @@ env:
matrix:
allow_failures:
- php: nightly
- php: 7.2

install:
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist
before_script:
- composer config platform.php $(php -r "echo PHP_VERSION;")
- travis_retry composer update --no-interaction --prefer-dist $COMPOSER_FLAGS

script:
- vendor/bin/phpcs -p --warning-severity=0 src/ tests/
Expand Down
46 changes: 29 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
SHELL = /bin/sh

DOCKER ?= $(shell which docker)
DOCKER_REPOSITORY := graze/php-alpine:7.1-test
VOLUME := /opt/graze/queue
VOLUME_MAP := -v $$(pwd):${VOLUME}
DOCKER_RUN_BASE := ${DOCKER} run --rm -t ${VOLUME_MAP} -w ${VOLUME}
DOCKER_RUN := ${DOCKER_RUN_BASE} ${DOCKER_REPOSITORY}
PHP_VER := 7.2
IMAGE := graze/php-alpine:${PHP_VER}-test
VOLUME := /srv
DOCKER_RUN_BASE := ${DOCKER} run --rm -t -v $$(pwd):${VOLUME} -w ${VOLUME}
DOCKER_RUN := ${DOCKER_RUN_BASE} ${IMAGE}

.PHONY: install composer clean help run
.PHONY: test lint lint-fix test-unit test-integration test-matrix test-coverage test-coverage-html test-coverage-clover
PREFER_LOWEST ?=

.PHONY: install composer help
.PHONY: test lint lint-fix test-unit test-integration test-matrix test-matrix-lowest
.PHONY: test-coverage test-coverage-html test-coverage-clover

.SILENT: help

# Building

build: ## Download the dependencies
make 'composer-install --optimize-autoloader'
build: ## Install the dependencies
build: ensure-composer-file
make 'composer-install --optimize-autoloader --prefer-dist ${PREFER_LOWEST}'

build-update: ## Update the dependencies
build-update: ensure-composer-file
make 'composer-update --optimize-autoloader --prefer-dist ${PREFER_LOWEST}'

build-update: ## Update and download the dependencies
make 'composer-update --optimize-autoloader'
ensure-composer-file: # Update the composer file
make 'composer-config platform.php ${PHP_VER}'

composer-%: ## Run a composer command, `make "composer-<command> [...]"`.
${DOCKER} run -t --rm \
-v $$(pwd):/app:delegated \
-v ~/.composer:/tmp:delegated \
composer --no-interaction --prefer-dist $* $(filter-out $@,$(MAKECMDGOALS))
-v ~/.ssh:/root/.ssh:ro \
composer --ansi --no-interaction $* $(filter-out $@,$(MAKECMDGOALS))

# Testing

Expand All @@ -43,12 +52,15 @@ test-unit: ## Run the unit testsuite.
test-integration: ## Run the integration testsuite.
${DOCKER_RUN} vendor/bin/phpunit --colors=always --testsuite integration

test-matrix-lowest: ## Test all version, with the lowest version
${MAKE} test-matrix PREFER_LOWEST='--prefer-lowest --prefer-stable'
${MAKE} build-update

test-matrix: ## Run the unit tests against multiple targets.
make DOCKER_REPOSITORY="php:5.6-alpine" test
make DOCKER_REPOSITORY="php:7.0-alpine" test
make DOCKER_REPOSITORY="php:7.1-alpine" test
make DOCKER_REPOSITORY="php:7.2-alpine" test
make DOCKER_REPOSITORY="hhvm/hhvm:latest" test
${MAKE} PHP_VER="5.6" build-update test
${MAKE} PHP_VER="7.0" build-update test
${MAKE} PHP_VER="7.1" build-update test
${MAKE} PHP_VER="7.2" build-update test

test-coverage: ## Run all tests and output coverage to the console.
${DOCKER_RUN} phpdbg7 -qrr vendor/bin/phpunit --coverage-text
Expand Down
78 changes: 42 additions & 36 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,45 @@
{
"name": "graze/queue",
"description": ":postbox: Flexible abstraction for working with queues in PHP.",
"license": "MIT",
"authors": [
{
"name": "Graze Developers",
"email": "[email protected]",
"homepage": "https://github.com/graze/queue/graphs/contributors"
}
],
"autoload": {
"psr-4": {
"Graze\\Queue\\": "src/"
}
},
"autoload-dev": {
"classmap": [
"tests/unit/",
"tests/integration"
]
},
"require": {
"php": ">=5.5",
"graze/data-structure": "^2.0"
},
"require-dev": {
"aws/aws-sdk-php": "^3.0",
"hamcrest/hamcrest-php": "^1.2",
"mockery/mockery": "^0.9",
"phpunit/phpunit": "^4.8",
"squizlabs/php_codesniffer": "^2.7,<2.8.1",
"graze/hamcrest-test-listener": "^1.0",
"graze/standards": "^1.0"
},
"suggest": {
"aws/aws-sdk-php": "Required when using the SQS Adapter"
"name": "graze/queue",
"description": ":postbox: Flexible abstraction for working with queues in PHP.",
"license": "MIT",
"authors": [
{
"name": "Graze Developers",
"email": "[email protected]",
"homepage": "https://github.com/graze/queue/graphs/contributors"
}
],
"autoload": {
"psr-4": {
"Graze\\Queue\\": "src/",
"Graze\\Queue\\Test\\": "tests/src/"
}
},
"autoload-dev": {
"classmap": [
"tests/unit/",
"tests/integration"
]
},
"require": {
"php": "^5.5|^7",
"graze/data-structure": "^2"
},
"require-dev": {
"aws/aws-sdk-php": "^3",
"hamcrest/hamcrest-php": "^2",
"mockery/mockery": "^1",
"phpunit/phpunit": "^5.7.21|^6|^7",
"squizlabs/php_codesniffer": "^3",
"graze/standards": "^2",
"graze/hamcrest-test-listener": "^2|^3"
},
"suggest": {
"aws/aws-sdk-php": "Required when using the SQS Adapter"
},
"config": {
"platform": {
"php": "7.2"
}
}
}
Loading

0 comments on commit c3a6f7f

Please sign in to comment.