Open hmiguel opened 9 months ago
At the moment, our support is limited to operations on a single machine. At this time, we do not have plans to introduce this feature. We will keep issue open to see interest.
@jakubch1 Is there an alternative approach how to retrieve the code coverage after I ran my test agast the running session integration-tests
as @hmiguel mentioned?
I thought is easily possible as described here, so I have the following:
Azure Pipeline:
dotnet-coverage collect --session-id my-tests-session -f xml -o coverage.xml dotnet App.dll
which runs fine.dotnet test --logger "trx;LogFileName=App.Tests.trx" App.Tests.dll
dotnet-coverage snapshot --output coverage-after-tests.xml my-tests-session
coverage-after-tests.xml
via kubectl cp
from the pod to the pipeline and see the results.
=> empty coverage xml file.Is that server shutdown needed? Should that snapshot not contain already the coverage I needed?
I just need the code coverage of the server/App side.
Again I followed this approach here, as you see. But I get an empty coverage result. What can be the reason for that?
Because I did that in the pipeline, and this coverage-after-tests.xml
is just an empty coverage xml file.
Would be great if you could support here.
P.S. The test results (App.Tests.trx
) looks good, and works, that I get successfully from the dotnet test command, but I guess this has nothing to do with the coverage and is a different thing.
Your scenario looks good and should be supported. My guess is that k8s pod is missing some coverage dependencies or pdbs are not available. Could you please collect logs in step 1. ?
Yes, here are the logs from step 1 in Verbose mode. logs-app.txt
How can I check, if pdbs are not available? I do not have any special configuration like in the docs here.
UPDATE (issue solved):
Actually I fixed the issue by installing the missing dependency libxml2
on the Alpine Linux where the App is running.
Thanks to your supported-os documentation 😊.
Hi again,
Now, after we refactored the Dockerfile to contain again a USER instruction for security reasons, to be non-root.
The code-coverage snapshot
returns with the error: "Invalid message tag."
What does that mean? Does it miss some privileges?
Thanks in advance.
It seems like coverage file is corrupt. Can you please share what command lines you are executing? And the coverage file?
Thanks for the response. We fixed it again, sorry. It turned out, that the file could not be written, due to permission issues on the Docker container.
What is private system firewall defender App's for
Hi!
This is probably an enhancement request, but my current issue is:
Consider a CI/CD pipeline @integration-tests stage.
container-a: -
./dotnet-coverage collect "Service.Api" --session-id integration-tests
container-b: -
dotnet tests IntegrationTests
... (against container A) -dotnet-coverage shutdown integration-tests
(unable to do it)I want to be able to execute a gracefull shutdown (or snapshot) of container-a via container-b. How to do it?
A possible enhancement could involve setting something like --address container-a-hostname
Thanks in advance