Skip to content

Commit

Permalink
Merge pull request #246 from DataDog/dev
Browse files Browse the repository at this point in the history
Merge dev into master
  • Loading branch information
labbati authored Jan 21, 2019
2 parents 9a69308 + 6c7812b commit 038957d
Show file tree
Hide file tree
Showing 3,207 changed files with 1,091,121 additions and 1,556 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
178 changes: 108 additions & 70 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,21 @@ aliases:
- MONGO_INITDB_ROOT_USERNAME=test
- MONGO_INITDB_ROOT_PASSWORD=test

- &IMAGE_DOCKER_REQUEST_REPLAYER
image: php:7.2
name: request_replayer
command: sh -c "curl --output index.php https://raw.githubusercontent.com/DataDog/dd-trace-php/dev/tests/request_replayer/index.php -q && php -S 0.0.0.0:80 index.php"
environment:
DD_REQUEST_DUMPER_FILE: dump.json

- &STEP_ATTACH_WORKSPACE
attach_workspace:
at: ~/datadog

- &STEP_EXT_INSTALL
run:
name: Build and install extension
command: make -f DDMakefile install install_ini SUDO=sudo BUILD_DIR=tmp/build_extension
command: make sudo install install_ini BUILD_DIR=tmp/build_extension

- &STEP_COMPOSER_SELF_UPDATE
run:
Expand All @@ -71,17 +78,11 @@ aliases:
paths:
- vendor/

- &STEP_COMPOSER_INSTALL_LEGACY
run:
name: Installing composer dependencies without PHPStan
command: composer remove phpstan/phpstan --no-interaction --no-plugins --dev

- &STEP_COMPOSER_INSTALL
run:
name: Installing dependencies with composer
command: composer install --no-interaction


- &STEP_PREPARE_TEST_RESULTS_DIR
run:
name: testresults dir
Expand All @@ -96,7 +97,7 @@ aliases:
- &STEP_RUN_EXTENSION_TESTS
run:
name: Run extension tests with leak detection
command: TEST_PHP_JUNIT=test-results/leak_test.xml REPORT_EXIT_STATUS=1 make -f DDMakefile test_c_mem
command: TEST_PHP_JUNIT=$(pwd)/test-results/leak_test.xml REPORT_EXIT_STATUS=1 make test_c_mem

- &STEP_WAIT_AGENT
run:
Expand All @@ -108,6 +109,11 @@ aliases:
name: Waiting for Dockerized MySQL
command: dockerize -wait tcp://mysql_integration:3306 -timeout 1m

- &STEP_WAIT_REQUEST_REPLAYER
run:
name: Waiting for Dockerized request replayer
command: dockerize -wait tcp://request_replayer:80/clear-dumped-data -timeout 2m

- &STEP_WAIT_MONGODB
run:
name: Waiting for Dockerized MongoDB
Expand All @@ -123,36 +129,6 @@ aliases:
name: Run integration tests
command: composer test-integration -- --log-junit test-results/php-integration/results.xml

- &STEP_UPDATE_LARAVEL_42_ENV
run:
name: Update the Laravel 4.2 test environment
command: composer laravel-42-update

- &STEP_UPDATE_LARAVEL_57_ENV
run:
name: Update the Laravel 5.7 test environment
command: composer laravel-57-update

- &STEP_UPDATE_SYMFONY_34_ENV
run:
name: Update the Symfony 3.4 test environment
command: composer symfony-34-update

- &STEP_RUN_LARAVEL_42_TESTS
run:
name: Run the Laravel 4.2 test suite
command: composer laravel-42-test

- &STEP_RUN_LARAVEL_57_TESTS
run:
name: Run the Laravel 5.7 test suite
command: composer laravel-57-test

- &STEP_RUN_SYMFONY_34_TESTS
run:
name: Run the Symfony 3.4 test suite
command: composer symfony-34-test

- &STEP_PERSIST_TO_WORKSPACE
persist_to_workspace:
root: '.'
Expand All @@ -170,6 +146,10 @@ aliases:

# Integrations tests execution

- &STEP_RUN_INTEGRATIONS_TESTS_54
run:
command: composer test-integrations-54

- &STEP_RUN_INTEGRATIONS_TESTS_56
run:
command: composer test-integrations-56
Expand All @@ -186,6 +166,26 @@ aliases:
run:
command: composer test-integrations-72

- &STEP_RUN_WEB_TESTS_54
run:
command: composer test-web-54

- &STEP_RUN_WEB_TESTS_56
run:
command: composer test-web-56

- &STEP_RUN_WEB_TESTS_70
run:
command: composer test-web-70

- &STEP_RUN_WEB_TESTS_71
run:
command: composer test-web-71

- &STEP_RUN_WEB_TESTS_72
run:
command: composer test-web-72


jobs:

Expand Down Expand Up @@ -248,9 +248,46 @@ jobs:
- <<: *STEP_COMPOSER_CACHE_RESTORE
- <<: *STEP_COMPOSER_INSTALL
- <<: *STEP_COMPOSER_CACHE_SAVE
- run:
name: Install phpstan
command: composer global require phpstan/phpstan
- run:
name: Running phpstan
command: composer static-analyze
command: PATH=$PATH:~/.composer/vendor/bin composer static-analyze

"php-5.4":
working_directory: ~/datadog
docker:
- image: datadog/docker-library:ddtrace_php_5_4
- <<: *IMAGE_DOCKER_DD_AGENT
- <<: *IMAGE_DOCKER_ELASTICSEARCH2
- <<: *IMAGE_DOCKER_HTTPBIN
- <<: *IMAGE_DOCKER_REDIS
- <<: *IMAGE_DOCKER_MEMCHACED
- <<: *IMAGE_DOCKER_MYSQL
- <<: *IMAGE_DOCKER_MONGODB
- <<: *IMAGE_DOCKER_REQUEST_REPLAYER
steps:
- checkout
- <<: *STEP_ATTACH_WORKSPACE
- <<: *STEP_EXT_INSTALL
- <<: *STEP_COMPOSER_SELF_UPDATE
- <<: *STEP_COMPOSER_CACHE_RESTORE
- <<: *STEP_COMPOSER_CACHE_SAVE
- <<: *STEP_PREPARE_TEST_RESULTS_DIR
- <<: *STEP_EXPORT_CI_ENV
- <<: *STEP_RUN_EXTENSION_TESTS
- <<: *STEP_WAIT_AGENT
- <<: *STEP_WAIT_MYSQL
- <<: *STEP_WAIT_MONGODB
- <<: *STEP_WAIT_REQUEST_REPLAYER
- <<: *STEP_RUN_UNIT_TESTS
- <<: *STEP_RUN_INTEGRATION_TESTS
- <<: *STEP_RUN_INTEGRATIONS_TESTS_54
- <<: *STEP_RUN_WEB_TESTS_54
- <<: *STEP_PERSIST_TO_WORKSPACE
- <<: *STEP_STORE_TEST_RESULTS
- <<: *STEP_STORE_ARTIFACTS

"php-5.6":
working_directory: ~/datadog
Expand All @@ -263,27 +300,25 @@ jobs:
- <<: *IMAGE_DOCKER_MEMCHACED
- <<: *IMAGE_DOCKER_MYSQL
- <<: *IMAGE_DOCKER_MONGODB
- <<: *IMAGE_DOCKER_REQUEST_REPLAYER
steps:
- checkout
- <<: *STEP_ATTACH_WORKSPACE
- <<: *STEP_EXT_INSTALL
- <<: *STEP_COMPOSER_SELF_UPDATE
- <<: *STEP_COMPOSER_CACHE_RESTORE
- <<: *STEP_COMPOSER_INSTALL_LEGACY
- <<: *STEP_COMPOSER_CACHE_SAVE
- <<: *STEP_PREPARE_TEST_RESULTS_DIR
- <<: *STEP_EXPORT_CI_ENV
- <<: *STEP_RUN_EXTENSION_TESTS
- <<: *STEP_WAIT_AGENT
- <<: *STEP_WAIT_MYSQL
- <<: *STEP_WAIT_MONGODB
- <<: *STEP_WAIT_REQUEST_REPLAYER
- <<: *STEP_RUN_UNIT_TESTS
- <<: *STEP_RUN_INTEGRATION_TESTS
- <<: *STEP_RUN_INTEGRATIONS_TESTS_56
- <<: *STEP_UPDATE_LARAVEL_42_ENV
- <<: *STEP_RUN_LARAVEL_42_TESTS
- <<: *STEP_UPDATE_SYMFONY_34_ENV
- <<: *STEP_RUN_SYMFONY_34_TESTS
- <<: *STEP_RUN_WEB_TESTS_56
- <<: *STEP_PERSIST_TO_WORKSPACE
- <<: *STEP_STORE_TEST_RESULTS
- <<: *STEP_STORE_ARTIFACTS
Expand All @@ -299,27 +334,25 @@ jobs:
- <<: *IMAGE_DOCKER_MEMCHACED
- <<: *IMAGE_DOCKER_MYSQL
- <<: *IMAGE_DOCKER_MONGODB
- <<: *IMAGE_DOCKER_REQUEST_REPLAYER
steps:
- checkout
- <<: *STEP_ATTACH_WORKSPACE
- <<: *STEP_EXT_INSTALL
- <<: *STEP_COMPOSER_SELF_UPDATE
- <<: *STEP_COMPOSER_CACHE_RESTORE
- <<: *STEP_COMPOSER_INSTALL_LEGACY
- <<: *STEP_COMPOSER_CACHE_SAVE
- <<: *STEP_PREPARE_TEST_RESULTS_DIR
- <<: *STEP_EXPORT_CI_ENV
- <<: *STEP_RUN_EXTENSION_TESTS
- <<: *STEP_WAIT_AGENT
- <<: *STEP_WAIT_MYSQL
- <<: *STEP_WAIT_MONGODB
- <<: *STEP_WAIT_REQUEST_REPLAYER
- <<: *STEP_RUN_UNIT_TESTS
- <<: *STEP_RUN_INTEGRATION_TESTS
- <<: *STEP_RUN_INTEGRATIONS_TESTS_70
- <<: *STEP_UPDATE_LARAVEL_42_ENV
- <<: *STEP_RUN_LARAVEL_42_TESTS
- <<: *STEP_UPDATE_SYMFONY_34_ENV
- <<: *STEP_RUN_SYMFONY_34_TESTS
- <<: *STEP_RUN_WEB_TESTS_70
- <<: *STEP_PERSIST_TO_WORKSPACE
- <<: *STEP_STORE_TEST_RESULTS
- <<: *STEP_STORE_ARTIFACTS
Expand All @@ -335,6 +368,7 @@ jobs:
- <<: *IMAGE_DOCKER_MEMCHACED
- <<: *IMAGE_DOCKER_MYSQL
- <<: *IMAGE_DOCKER_MONGODB
- <<: *IMAGE_DOCKER_REQUEST_REPLAYER
steps:
- checkout
- <<: *STEP_ATTACH_WORKSPACE
Expand All @@ -349,15 +383,11 @@ jobs:
- <<: *STEP_WAIT_AGENT
- <<: *STEP_WAIT_MYSQL
- <<: *STEP_WAIT_MONGODB
- <<: *STEP_WAIT_REQUEST_REPLAYER
- <<: *STEP_RUN_UNIT_TESTS
- <<: *STEP_RUN_INTEGRATION_TESTS
- <<: *STEP_RUN_INTEGRATIONS_TESTS_71
- <<: *STEP_UPDATE_LARAVEL_42_ENV
- <<: *STEP_RUN_LARAVEL_42_TESTS
- <<: *STEP_UPDATE_LARAVEL_57_ENV
- <<: *STEP_RUN_LARAVEL_57_TESTS
- <<: *STEP_UPDATE_SYMFONY_34_ENV
- <<: *STEP_RUN_SYMFONY_34_TESTS
- <<: *STEP_RUN_WEB_TESTS_71
- <<: *STEP_PERSIST_TO_WORKSPACE
- <<: *STEP_STORE_TEST_RESULTS
- <<: *STEP_STORE_ARTIFACTS
Expand All @@ -373,6 +403,7 @@ jobs:
- <<: *IMAGE_DOCKER_MEMCHACED
- <<: *IMAGE_DOCKER_MYSQL
- <<: *IMAGE_DOCKER_MONGODB
- <<: *IMAGE_DOCKER_REQUEST_REPLAYER
steps:
- checkout
- <<: *STEP_ATTACH_WORKSPACE
Expand All @@ -387,22 +418,20 @@ jobs:
- <<: *STEP_WAIT_AGENT
- <<: *STEP_WAIT_MYSQL
- <<: *STEP_WAIT_MONGODB
- <<: *STEP_WAIT_REQUEST_REPLAYER
- <<: *STEP_RUN_UNIT_TESTS
- <<: *STEP_RUN_INTEGRATION_TESTS
- <<: *STEP_RUN_INTEGRATIONS_TESTS_72
- <<: *STEP_UPDATE_LARAVEL_42_ENV
- <<: *STEP_RUN_LARAVEL_42_TESTS
- <<: *STEP_UPDATE_LARAVEL_57_ENV
- <<: *STEP_RUN_LARAVEL_57_TESTS
- <<: *STEP_UPDATE_SYMFONY_34_ENV
- <<: *STEP_RUN_SYMFONY_34_TESTS
- <<: *STEP_RUN_WEB_TESTS_72
- <<: *STEP_PERSIST_TO_WORKSPACE
- <<: *STEP_STORE_TEST_RESULTS
- <<: *STEP_STORE_ARTIFACTS

"5.6 20131106": &ARTIFACT_BUILD
"5.4 20100525": &5_4_ARTIFACT_BUILD
working_directory: ~/datadog
docker: [ image: 'circleci/php:5.6' ]
docker: [ image: 'datadog/docker-library:ddtrace_php_5_4' ]
environment:
CFLAGS: "-O2 -Wall -Wextra"
steps:
- checkout
- attach_workspace:
Expand All @@ -411,24 +440,30 @@ jobs:
name: Build extension .so
command: |
mkdir -p extensions
make -f DDMakefile all CFLAGS="-O2 -Wall -Werror -Wextra"
make all CFLAGS="${CFLAGS}"
SUFFIX="$( echo "$CIRCLE_JOB" | awk '{print $NF}' )"
cp tmp/build_extension/.libs/ddtrace.so extensions/ddtrace-$SUFFIX.so
- persist_to_workspace:
root: '.'
paths: ['./extensions']

"5.6 20131106": &ARTIFACT_BUILD
<<: *5_4_ARTIFACT_BUILD
environment:
CFLAGS: "-O2 -Wall -Wextra -Wextra"
docker: [ image: 'datadog/docker-library:ddtrace_php_5_6' ]

"7.0 20151012":
<<: *ARTIFACT_BUILD
docker: [ image: 'circleci/php:7.0' ]
docker: [ image: 'datadog/docker-library:ddtrace_php_7_0' ]

"7.1 20160303":
<<: *ARTIFACT_BUILD
docker: [ image: 'circleci/php:7.1' ]
docker: [ image: 'datadog/docker-library:ddtrace_php_7_1' ]

"7.2 20170718":
<<: *ARTIFACT_BUILD
docker: [ image: 'circleci/php:7.2' ]
docker: [ image: 'datadog/docker-library:ddtrace_php_7_2' ]

"5.6 zts 20131106-zts":
<<: *ARTIFACT_BUILD
Expand Down Expand Up @@ -458,7 +493,7 @@ jobs:
command: sudo apt-get update && sudo apt-get install -y ruby ruby-dev rubygems build-essential rpm && sudo gem install --no-ri --no-rdoc fpm
- run:
name: Build packages
command: make -f DDMakefile packages
command: make packages
- store_artifacts: { path: 'build/packages', destination: / }
- store_artifacts: { path: 'packages.tar.gz', destination: '/all/packages.tar.gz' }
- setup_remote_docker
Expand All @@ -470,13 +505,14 @@ workflows:
version: 2
build_packages:
jobs:
- "5.6 20131106": &BUILD_PACKAGE_FORKFLOW
- "5.4 20100525": &BUILD_PACKAGE_FORKFLOW
filters:
tags:
only: /(^build$)|(^[v]?[0-9]+(\.[0-9]+)*$)/
branches:
# Always build on master
ignore: /^(?!master$).*/
ignore: /^(?!master).*/
- "5.6 20131106": *BUILD_PACKAGE_FORKFLOW
- "7.0 20151012": *BUILD_PACKAGE_FORKFLOW
- "7.1 20160303": *BUILD_PACKAGE_FORKFLOW
- "7.2 20170718": *BUILD_PACKAGE_FORKFLOW
Expand All @@ -486,6 +522,7 @@ workflows:
- "7.2 zts 20170718-zts": *BUILD_PACKAGE_FORKFLOW
- "package extension":
requires:
- "5.4 20100525"
- "5.6 20131106"
- "7.0 20151012"
- "7.1 20160303"
Expand All @@ -498,6 +535,7 @@ workflows:
jobs:
- "Lint files"
- "Static Analysis"
- "php-5.4"
- "php-5.6"
- "php-7.0"
- "php-7.1"
Expand Down
Loading

0 comments on commit 038957d

Please sign in to comment.