Conversation
|
Can one of the admins verify this patch? |
|
ok to test |
|
retest this please |
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
2 similar comments
|
retest this please |
|
retest this please |
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
|
Refer to this link for build results (access rights to CI server needed): |
| tmp="$(mktemp)" | ||
| go test -v -coverprofile covProfile "$pkg" > "$tmp" | ||
| mv -f "$tmp" coverage_out1 | ||
| done |
There was a problem hiding this comment.
It looks like you're now building the coverage profiles twice but only reading the results once, and you're no longer writing anything into result.txt (which might be okay - is it?). My script that I posted in a comment on my earlier review wasn't meant as a verbatim example of how to accomplish what you're trying to do, merely show that the two ways of getting a coverage profile would produce equivalent results.
All you gotta do here is take that bottom for loop and paste it over the top one, I think. But it is missing some things, including a line which I missed in my comment originally (which I think is why). The actual loop should look like:
touch coverage_out
covtmp="$(mktemp)"
covMergeTmp="$(mktemp)"
for pkg in $(go list $@ | grep -v vendor); do
tmp="$(mktemp)"
go test -v -coverprofile "$covtmp" | tee -a result.txt
gocovmerge coverage_out "$covtmp" > "$covMergeTmp"
mv -f "$covMergeTmp" coverage_out
done;which gets you what you're looking for in result.txt as well as coverage_out.
Then, of course, there's no need to initialize coverage_out as a variable (since it's a file now) or i, and the gocovmerge line can be deleted.
What does this PR (Pull Request) do?
Adds unit test coverage generation for TO and TM
Which Traffic Control components are affected by this PR?
This doesn't affect the functionality of the any component. Just exposes the unit test coverage for TO and TM components. Testing, documentation, changelog is not required.
What is the best way to verify this PR?
Jenkins job should show coverage information by func

The following criteria are ALL met by this PR