Skip to content

Commit 072c941

Browse files
committed
Merge branch 'main' into 918_modernbuild_draft_centos_merge
2 parents 83aaacc + b5e1296 commit 072c941

File tree

168 files changed

+14538
-2581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+14538
-2581
lines changed

.ci/run-phpt-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ AGENT_EXTENSION=$AGENT_EXTENSION_DIR/elastic_apm-$PHP_API.so
4646

4747
ls -al $AGENT_EXTENSION_DIR
4848

49-
RUN_TESTS=$(find /usr/local/lib/php -type f -name run-tests.php)
49+
RUN_TESTS=./tests/run-tests.php
5050

5151
#Disable agent for auxiliary PHP processes to reduce noise in logs
5252
export ELASTIC_APM_ENABLED=false

.ci/run_docker_with_component_tests.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ function shouldPassEnvVarToDocker () {
2929
}
3030

3131
function buildDockerEnvVarsCommandLinePart () {
32+
# $1 should be the name of the environment variable to hold the result
33+
# local -n makes `result' reference to the variable named by $1
3234
local -n result=$1
3335
result=()
3436
# Iterate over environment variables
@@ -79,6 +81,8 @@ function onScriptExit () {
7981
}
8082

8183
function main () {
84+
local dockerToRunImageName=${1:?}
85+
8286
if [ -z "${ELASTIC_APM_PHP_TESTS_MATRIX_ROW}" ] ; then
8387
echo "ELASTIC_APM_PHP_TESTS_MATRIX_ROW environment variable should be set before calling ${BASH_SOURCE[0]}"
8488
exit 1
@@ -96,12 +100,24 @@ function main () {
96100

97101
repoRootDir="$( realpath "${thisScriptDir}/.." )"
98102

99-
buildDockerEnvVarsCommandLinePart dockerRunCmdVariablePart
103+
buildDockerEnvVarsCommandLinePart dockerRunCmdLineArgs
104+
105+
# Let the tests know that are being run inside a container
106+
dockerRunCmdLineArgs=("${dockerRunCmdLineArgs[@]}" -e "ELASTIC_APM_PHP_TESTS_IS_IN_CONTAINER=true")
107+
108+
# ELASTIC_APM_PHP_TESTS_THIS_CONTAINER_IMAGE_NAME is used by tests to find container ID
109+
dockerRunCmdLineArgs=("${dockerRunCmdLineArgs[@]}" -e "ELASTIC_APM_PHP_TESTS_THIS_CONTAINER_IMAGE_NAME=${dockerToRunImageName}")
110+
100111
if [ "${shouldStartExternalServices}" == "true" ] ; then
101-
dockerRunCmdVariablePart=("${dockerRunCmdVariablePart[@]}" "--network=elastic-apm-php-external-services-for-component-tests-net")
112+
dockerRunCmdLineArgs=("${dockerRunCmdLineArgs[@]}" "--network=elastic-apm-php-external-services-for-component-tests-net")
102113
fi
103-
# shellcheck disable=SC2154 # dockerRunCmdVariablePart is assigned by buildDockerEnvVarsCommandLinePart
104-
docker run --rm -v "${repoRootDir}:/app" -w /app "${dockerRunCmdVariablePart[@]}" "$@"
114+
115+
dockerRunCmdLineArgs=("${dockerRunCmdLineArgs[@]}" -v /var/run/docker.sock:/var/run/docker.sock)
116+
dockerRunCmdLineArgs=("${dockerRunCmdLineArgs[@]}" -v "${repoRootDir}:/app")
117+
dockerRunCmdLineArgs=("${dockerRunCmdLineArgs[@]}" -w /app)
118+
119+
# shellcheck disable=SC2154 # dockerRunCmdLineArgs is assigned by buildDockerEnvVarsCommandLinePart
120+
docker run --rm -w /app "${dockerRunCmdLineArgs[@]}" "$@"
105121
}
106122

107123
main "$@"

.ci/shared.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,22 @@ function copySyslogFilesAndPrintTheMostRecentOne () {
7777
done
7878
fi
7979
}
80+
81+
function runPhpCoposerInstall () {
82+
local run_command_with_timeout_and_retries_args=(--max-tries=3)
83+
run_command_with_timeout_and_retries_args=(--retry-on-error=yes "${run_command_with_timeout_and_retries_args[@]}")
84+
local initialTimeoutInMinutes=5
85+
local initialTimeoutInSeconds=$((initialTimeoutInMinutes*60))
86+
run_command_with_timeout_and_retries_args=(--timeout="${initialTimeoutInSeconds}" "${run_command_with_timeout_and_retries_args[@]}")
87+
run_command_with_timeout_and_retries_args=(--increase-timeout-exponentially=yes "${run_command_with_timeout_and_retries_args[@]}")
88+
run_command_with_timeout_and_retries_args=(--wait-time-before-retry="${initialTimeoutInSeconds}" "${run_command_with_timeout_and_retries_args[@]}")
89+
90+
set +e
91+
.ci/run_command_with_timeout_and_retries.sh "${run_command_with_timeout_and_retries_args[@]}" -- composer install
92+
local composerCommandExitCode=$?
93+
set -e
94+
95+
if [ ${composerCommandExitCode} -ne 0 ] ; then
96+
exit ${composerCommandExitCode}
97+
fi
98+
}

.ci/static-check-unit-test.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ ensureSyslogIsRunning
3636
# echo "${msg}"
3737
# this_script_name="$( basename "${BASH_SOURCE[0]}" )"
3838
# logger -t "${this_script_name}" "${msg}"
39-
4039
# # Disable exit-on-error
4140
# set +e
4241
# make test TESTS="--show-all ${phptFile}"
@@ -97,7 +96,7 @@ echo 'Set Elastic related environment variables:'
9796
env | grep ELASTIC || true
9897

9998
# Install 3rd party dependencies
100-
composer install
99+
runPhpCoposerInstall
101100

102101
# Run static checks
103102
composer run-script static_check

.ci/validate_agent_installation.sh

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function printInfoAboutEnvironment () {
77
echo 'Installed PHP extensions:'
88
php -m
99
echo 'Set Elastic related environment variables:'
10-
env | grep ELASTIC || true
10+
env | grep -i elastic | sort || true
1111
}
1212

1313
function runComponentTests () {
@@ -61,25 +61,6 @@ function runComponentTests () {
6161
exit ${composerCommandExitCode}
6262
}
6363

64-
function runPhpCoposerInstall () {
65-
local run_command_with_timeout_and_retries_args=(--max-tries=3)
66-
run_command_with_timeout_and_retries_args=(--retry-on-error=yes "${run_command_with_timeout_and_retries_args[@]}")
67-
local initialTimeoutInMinutes=5
68-
local initialTimeoutInSeconds=$((initialTimeoutInMinutes*60))
69-
run_command_with_timeout_and_retries_args=(--timeout="${initialTimeoutInSeconds}" "${run_command_with_timeout_and_retries_args[@]}")
70-
run_command_with_timeout_and_retries_args=(--increase-timeout-exponentially=yes "${run_command_with_timeout_and_retries_args[@]}")
71-
run_command_with_timeout_and_retries_args=(--wait-time-before-retry="${initialTimeoutInSeconds}" "${run_command_with_timeout_and_retries_args[@]}")
72-
73-
set +e
74-
.ci/run_command_with_timeout_and_retries.sh "${run_command_with_timeout_and_retries_args[@]}" -- composer install
75-
local composerCommandExitCode=$?
76-
set -e
77-
78-
if [ ${composerCommandExitCode} -ne 0 ] ; then
79-
exit ${composerCommandExitCode}
80-
fi
81-
}
82-
8364
function main () {
8465
thisScriptDir="$( dirname "${BASH_SOURCE[0]}" )"
8566
thisScriptDir="$( realpath "${thisScriptDir}" )"

CHANGELOG.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ endif::[]
2020
2121
// Using the template above, release notes go here.
2222
// CHANGELOG_AUTOMATION_KEYWORD
23+
[[release-notes-v1.8.4]]
24+
=== v1.8.4 - 2023/05/17
25+
[float]
26+
==== Bug fixes
27+
* Fixed deadlock caused by use of pthread_atfork {pull}964[#964]
28+
* Fixed verify_server_cert=false not disabling all the checks related to HTTPS certificate {pull}965[#965]
29+
* Fixed not joining background sender thread if there was fork after module init {pull}959[#959]
30+
2331
[[release-notes-v1.8.3]]
2432
=== v1.8.3 - 2023/04/21
2533
[float]

Dockerfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG PHP_VERSION=7.2
2-
FROM php:${PHP_VERSION}-fpm
2+
FROM php:${PHP_VERSION}-fpm-buster
33

44
RUN apt-get -qq update \
55
&& apt-get -qq -y --no-install-recommends install \
@@ -30,8 +30,3 @@ ENV ELASTIC_APM_ENABLED=false
3030

3131
# Create a link to extensions directory to make it easier accessible (paths are different between php releases)
3232
RUN ln -s `find /usr/local/lib/php/extensions/ -name opcache.so | head -n1 | xargs dirname` /tmp/extensions
33-
34-
# Patch run-tests.php to handle SKIPIF correctly in tests with agent debug logs enabled
35-
RUN find /usr/local/lib/php/ -name run-tests.php | xargs sed -i 's#if (!strncasecmp(\x27skip\x27, ltrim(\$output), 4))#if (!strncasecmp(\x27skip\x27, ltrim(\$output), 4) || strstr(\$output, \x27ElasticApmSkipTest\x27))#g'
36-
37-
RUN find /usr/local/lib/php/ -name run-tests.php | xargs sed -i 's#system_with_timeout("\$extra \$php \$pass_options -q \$ini_settings \$no_file_cache -d display_errors=0 \\"\$test_skipif\\"", \$env)#system_with_timeout("\$extra \$php \$pass_options -q \$ini_settings \$no_file_cache -d display_errors=0 \\"\$test_skipif\\" 2>\&1", \$env)#g'

Dockerfile.alpine

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,3 @@ ENV ELASTIC_APM_ENABLED=false
3838

3939
# Create a link to extensions directory to make it easier accessible (paths are different between php releases)
4040
RUN ln -s `find /usr/local/lib/php/extensions/ -name opcache.so | head -n1 | xargs dirname` /tmp/extensions
41-
42-
# Patch run-tests.php to handle SKIPIF correctly in tests with agent debug logs enabled
43-
RUN find /usr/local/lib/php/ -name run-tests.php | xargs sed -i 's#if (!strncasecmp(\x27skip\x27, ltrim(\$output), 4))#if (!strncasecmp("skip", ltrim(\$output), 4) || strstr(\$output, "ElasticApmSkipTest"))#g'
44-
45-
RUN find /usr/local/lib/php/ -name run-tests.php | xargs sed -i 's#system_with_timeout("\$extra \$php \$pass_options -q \$ini_settings \$no_file_cache -d display_errors=0 \\"\$test_skipif\\"", \$env)#system_with_timeout("\$extra \$php \$pass_options -q \$ini_settings \$no_file_cache -d display_errors=0 \\"\$test_skipif\\" 2>\&1", \$env)#g'

0 commit comments

Comments
 (0)