Skip to content

Commit 1856dd0

Browse files
committed
Fix Appsec integration tests
1 parent 2cbe028 commit 1856dd0

5 files changed

Lines changed: 9 additions & 2 deletions

File tree

appsec/tests/integration/src/main/groovy/com/datadog/appsec/php/docker/AppSecContainer.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class AppSecContainer<SELF extends AppSecContainer<SELF>> extends GenericContain
7676
withEnv 'DD_TRACE_LOG_LEVEL', 'info,startup=off'
7777
withEnv 'DD_TRACE_AGENT_FLUSH_AFTER_N_REQUESTS', '0'
7878
withEnv 'DD_TRACE_AGENT_FLUSH_INTERVAL', '0'
79+
withEnv 'DD_TRACE_SIDECAR_TRACE_SENDER', '0'
7980
withEnv 'DD_TRACE_DEBUG', '1'
8081
withEnv 'DD_AUTOLOAD_NO_COMPILE', 'true' // must be exactly 'true'
8182
withEnv 'DD_TRACE_GIT_METADATA_ENABLED', '0'

appsec/tests/integration/src/main/groovy/com/datadog/appsec/php/mock_agent/TracesV04Handler.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ class TracesV04Handler implements Handler {
101101
List<Object> traces = []
102102
MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(is)
103103
while (unpacker.hasNext()) {
104-
traces << MsgpackHelper.unpackSingle(unpacker)
104+
def trace = MsgpackHelper.unpackSingle(unpacker)
105+
log.debug('Read submitted trace {}', trace)
106+
traces << trace
105107
}
106108

107109
traces.first() as List<Object> ?: []

appsec/tests/integration/src/test/groovy/com/datadog/appsec/php/integration/CommonTests.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ trait CommonTests {
392392
void 'module does not have STATIC_TLS flag'() {
393393
Container.ExecResult res = container.execInContainer(
394394
'bash', '-c',
395-
'''! { readelf -d "$(php -r 'echo ini_get("extension_dir");')"/ddappsec.so | grep STATIC_TLS; }''')
395+
'''! { readelf -d "$(DD_TRACE_CLI_ENABLED=0 php -r 'echo ini_get("extension_dir");')"/ddappsec.so | grep STATIC_TLS; }''')
396396
if (res.exitCode != 0) {
397397
throw new AssertionError("Module has STATIC_TLS flag: $res.stdout")
398398
}

appsec/tests/integration/src/test/www/laravel8x/initialize.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
cd /var/www
44

5+
export DD_TRACE_CLI_ENABLED=false
6+
57
composer install --no-dev
68
chown -R www-data.www-data vendor
79

appsec/tests/integration/src/test/www/symfony62/initialize.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
cd /var/www
44

5+
export DD_TRACE_CLI_ENABLED=false
6+
57
composer install
68
php bin/console doctrine:database:drop --force
79
php bin/console doctrine:database:create

0 commit comments

Comments
 (0)