Skip to content

Commit 2334652

Browse files
committed
test: add debug logs
Signed-off-by: Alexandre Rulleau <[email protected]>
1 parent 9b0c55d commit 2334652

File tree

3 files changed

+55
-10
lines changed

3 files changed

+55
-10
lines changed

docker-compose.linux.override.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ services:
1616
# --- Alpine ---
1717
'8.0-alpine': { <<: *linux_php_service }
1818
# --- Buster ---
19-
'7.0-buster': { <<: *linux_php_service }
20-
'7.1-buster': { <<: *linux_php_service }
21-
'7.2-buster': { <<: *linux_php_service }
22-
'7.3-buster': { <<: *linux_php_service }
23-
'7.4-buster': { <<: *linux_php_service }
24-
'8.0-buster': { <<: *linux_php_service }
25-
'8.1-buster': { <<: *linux_php_service }
26-
'8.2-buster': { <<: *linux_php_service }
27-
'8.3-buster': { <<: *linux_php_service }
28-
'8.4-buster': { <<: *linux_php_service }
19+
'7.0-bookworm': { <<: *linux_php_service }
20+
'7.1-bookworm': { <<: *linux_php_service }
21+
'7.2-bookworm': { <<: *linux_php_service }
22+
'7.3-bookworm': { <<: *linux_php_service }
23+
'7.4-bookworm': { <<: *linux_php_service }
24+
'8.0-bookworm': { <<: *linux_php_service }
25+
'8.1-bookworm': { <<: *linux_php_service }
26+
'8.2-bookworm': { <<: *linux_php_service }
27+
'8.3-bookworm': { <<: *linux_php_service }
28+
'8.4-bookworm': { <<: *linux_php_service }

tests/ext/library_config/fleet_config.phpt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ copy(__DIR__.'/fleet_config.yaml', '/tmp/test_c_fleet_config.yaml');
1818
_DD_TEST_LIBRARY_CONFIG_FLEET_FILE=/tmp/test_c_fleet_config.yaml
1919
_DD_TEST_LIBRARY_CONFIG_LOCAL_FILE=/foo
2020
DD_TRACE_SPANS_LIMIT=42
21+
DD_TRACE_DEBUG=1
22+
DD_TRACE_LOG_FILE=/tmp/log-fleet-config.txt
2123
--INI--
2224
datadog.trace.agent_url="file://{PWD}/fleet-config-telemetry.out"
2325
--FILE--
@@ -68,6 +70,27 @@ for ($i = 0; $i < 100; ++$i) {
6870
}
6971
}
7072

73+
74+
if (!file_exists(__DIR__ . '/fleet-config-telemetry.out')) {
75+
echo "Telemetry file not found\n";
76+
77+
$logFile = '/tmp/log-fleet-config.txt';
78+
if (file_exists($logFile)) {
79+
echo "Dumping log preview:\n";
80+
$handle = fopen($logFile, 'r');
81+
if ($handle) {
82+
$lineCount = 0;
83+
while (!feof($handle) && $lineCount < 10000) {
84+
echo fgets($handle);
85+
$lineCount++;
86+
}
87+
fclose($handle);
88+
}
89+
} else {
90+
echo "Log file does not exist\n";
91+
}
92+
}
93+
7194
?>
7295
--EXPECT--
7396
DD_SERVICE: service_from_fleet_config

tests/ext/library_config/local_config.phpt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ copy(__DIR__.'/local_config.yaml', '/tmp/test_c_local_config.yaml');
1818
_DD_TEST_LIBRARY_CONFIG_FLEET_FILE=/foo
1919
_DD_TEST_LIBRARY_CONFIG_LOCAL_FILE=/tmp/test_c_local_config.yaml
2020
DD_TRACE_SPANS_LIMIT=42
21+
DD_TRACE_DEBUG=1
22+
DD_TRACE_LOG_FILE=/tmp/log-local-config.txt
2123
--INI--
2224
datadog.trace.agent_url="file://{PWD}/local-config-telemetry.out"
2325
--FILE--
@@ -68,6 +70,26 @@ for ($i = 0; $i < 100; ++$i) {
6870
}
6971
}
7072

73+
if (!file_exists(__DIR__ . '/local-config-telemetry.out')) {
74+
echo "Telemetry file not found\n";
75+
76+
$logFile = '/tmp/log-local-config.txt';
77+
if (file_exists($logFile)) {
78+
echo "Dumping log preview:\n";
79+
$handle = fopen($logFile, 'r');
80+
if ($handle) {
81+
$lineCount = 0;
82+
while (!feof($handle) && $lineCount < 10000) {
83+
echo fgets($handle);
84+
$lineCount++;
85+
}
86+
fclose($handle);
87+
}
88+
} else {
89+
echo "Log file does not exist\n";
90+
}
91+
}
92+
7193
?>
7294
--EXPECT--
7395
DD_SERVICE: service_from_local_config

0 commit comments

Comments
 (0)