Skip to content

Commit 6b20ef8

Browse files
committed
Tests: FIXUP sonarqubed functionality.
1 parent 43ba205 commit 6b20ef8

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ on_finish:
119119
"https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)",
120120
(Resolve-Path .\junit-results.xml)
121121
)
122+
123+
- "%CMD_IN_ENV% python tests/scripts/appveyor/fixup_wrapper.py sonar/build-wrapper-dump.json"
122124
- ps: |
123125
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
124126
sonar-scanner `
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import sys
2+
import json
3+
4+
wrapper_file = open(sys.argv[1], 'r+')
5+
6+
line = '#'
7+
while line.startswith('#'):
8+
pos = wrapper_file.tell()
9+
line = wrapper_file.readline()
10+
11+
wrapper_file.seek(pos)
12+
13+
wrapper = json.loads(wrapper_file.read())
14+
15+
for i in range(len(wrapper['captures'])):
16+
wrapper['captures'][i]['stdout'] = wrapper['captures'][0]['stdout']
17+
wrapper['captures'][i]['stderr'] = wrapper['captures'][0]['stderr']
18+
19+
wrapper_file.write(json.dumps(wrapper))

0 commit comments

Comments
 (0)