From 8f3646a9c93a06f76f6abb31020fdb74b4b1fc59 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 9 Apr 2023 20:50:33 +0300 Subject: exp: jaeger tracing --- .../jaeger-client-php/tests/php-test.sh | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 vendor/jonahgeorge/jaeger-client-php/tests/php-test.sh (limited to 'vendor/jonahgeorge/jaeger-client-php/tests/php-test.sh') diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/php-test.sh b/vendor/jonahgeorge/jaeger-client-php/tests/php-test.sh new file mode 100644 index 000000000..99a522856 --- /dev/null +++ b/vendor/jonahgeorge/jaeger-client-php/tests/php-test.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash + +# trace ERR through pipes +set -o pipefail + +# trace ERR through 'time command' and other functions +set -o errtrace + +# set -u : exit the script if you try to use an uninitialised variable +set -o nounset + +# set -e : exit the script if any statement returns a non-true return value +set -o errexit + +# to avoid message: +# "Do not run Composer as root/super user! See https://getcomposer.org/root for details" +export COMPOSER_ALLOW_SUPERUSER=1 + +export TERM=xterm-256color + +echo "[INFO]: Install OS dependencies..." +apt-get update -yq > /dev/null 2>&1 +apt-get install -yq git wget unzip zip > /dev/null 2>&1 + +echo "[INFO]: Install PHP extensions..." +docker-php-ext-install bcmath sockets > /dev/null 2>&1 +pecl install hrtime > /dev/null 2>&1 +docker-php-ext-enable hrtime > /dev/null 2>&1 + +echo "[INFO]: Install Xdebug to enable code coverage..." +pecl install xdebug > /dev/null 2>&1 +docker-php-ext-enable xdebug > /dev/null 2>&1 + +cd /tmp + +echo "[INFO]: Install Composer..." +EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")" + +if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then + >&2 echo '[ERROR]: Invalid installer signature' + rm composer-setup.php + exit 1 +fi + +php composer-setup.php --quiet +rm composer-setup.php + +# this step is required to be able to overwrite composer.lock +cp -R /usr/app /usr/tests + +cd /usr/tests +rm -f composer.lock + +echo "[INFO]: Install library dependencies..." +php /tmp/composer.phar install \ + --no-interaction \ + --no-ansi \ + --no-progress \ + --no-suggest + +echo -e "[INFO]: Run tests...\n" +/tmp/composer.phar test -- cgit v1.2.3