Skip to content

Commit b76ed09

Browse files
fix(cpp): address Greptile P1s (mockapi discovery and CI build optimization)
1 parent d90fee9 commit b76ed09

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/sdk-build-validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ jobs:
250250
cargo test --lib
251251
;;
252252
cpp)
253-
cmake -S . -B build -DAPPWRITE_BUILD_TESTS=ON
254-
cmake --build build
253+
cmake -S . -B build -DAPPWRITE_BUILD_TESTS=ON -DCMAKE_PREFIX_PATH=/usr/local
254+
cmake --build build -j$(nproc)
255255
ctest --test-dir build --output-on-failure
256256
;;
257257
*)

tests/Cpp20Test.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ public function setUp(): void
4040
while ($attempts < $maxAttempts) {
4141
$output = [];
4242
$resultCode = 0;
43-
\exec('docker exec mockapi curl -sf http://localhost/v1/health/version 2>/dev/null', $output, $resultCode);
43+
// Greptile fix: Query the actual container name (Compose adds prefixes like sdk-generator-mockapi-1)
44+
$names = [];
45+
\exec('docker ps --filter "name=mockapi" --format "{{.Names}}" 2>/dev/null', $names);
46+
$containerName = $names[0] ?? 'mockapi';
47+
\exec("docker exec {$containerName} curl -sf http://localhost/v1/health/version 2>/dev/null", $output, $resultCode);
4448
if ($resultCode === 0 && !empty($output)) {
4549
return;
4650
}

0 commit comments

Comments
 (0)