Skip to content

Commit ccbbae9

Browse files
authored
chore(ci): add datadog test optimization (#183)
1 parent 7f08c3d commit ccbbae9

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.circleci/config.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,15 @@ jobs:
122122
name: Testing
123123
command: |
124124
& 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\Launch-VsDevShell.ps1' -arch << parameters.arch >>
125-
.\build\test\tests.exe
125+
.\build\test\tests.exe -r junit -o report.xml
126+
- run:
127+
name: Upload test report to Datadog
128+
when: always
129+
command: |
130+
Invoke-WebRequest -Uri "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_win-x64" -OutFile "datadog-ci.exe"
131+
Start-Process -FilePath "./datadog-ci.exe" -ArgumentList "upload --service dd-trace-cpp report.xml"
132+
- store_test_results:
133+
path: report.xml
126134

127135
build-and-test-cmake:
128136
parameters:
@@ -139,7 +147,20 @@ jobs:
139147
- checkout
140148
- run: bin/with-toolchain << parameters.toolchain >> cmake . -B .build -DCMAKE_BUILD_TYPE=Debug -DDD_TRACE_BUILD_TESTING=1
141149
- run: cmake --build .build -j ${MAKE_JOB_COUNT} -v
142-
- run: cd .build && test/tests
150+
- run: cd .build && test/tests -r junit -o report.xml
151+
- run:
152+
name: Upload test report to Datadog
153+
when: always
154+
command: |
155+
if [[ "<< parameters.arch >>" == "amd64" ]]; then
156+
curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-x64" --output "/usr/local/bin/datadog-ci" && chmod +x /usr/local/bin/datadog-ci
157+
else
158+
curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-arm64" --output "/usr/local/bin/datadog-ci" && chmod +x /usr/local/bin/datadog-ci
159+
fi
160+
161+
datadog-ci junit upload --service dd-trace-cpp .build/report.xml
162+
- store_test_results:
163+
path: .build/report.xml
143164

144165
coverage:
145166
docker:

0 commit comments

Comments
 (0)