镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Enable Command Execution Across Containers/Network #103

Open

Description

@hmiguel

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

Activity

  1. jakubch1 commented on Feb 20, 2024

    @jakubch1
    Member

    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.

  2. sahinM commented on Jun 19, 2024

    @sahinM
    Contributor

    Jakub Chocholowicz (@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:

    1. Starting an app in a K8s pod by an ENTRYPOINT:
      dotnet-coverage collect --session-id my-tests-session -f xml -o coverage.xml dotnet App.dll
      which runs fine.
    2. Running tests from the pipeline (obviously from the Azure pipeline build agent and NOT within the same pod) by:
      dotnet test --logger "trx;LogFileName=App.Tests.trx" App.Tests.dll
    3. Get the snapshot coverage after the tests are executed by:
      dotnet-coverage snapshot --output coverage-after-tests.xml my-tests-session
    4. Copy that file coverage-after-tests.xml via kubectl cp from the pod to the pipeline and see the results.
      => empty coverage xml file.
    5. I cannot do server shutdown and get the final coverage as well as hmiguel stated, since the pod/container gets terminated, and I cannot just copy then the coverage file to the outside, and retrieve it from the build agent, I mean I could but it would be non-trivial thing.
      But in my case, the snapshot (which I thought is just the coverage of the app in time, after you performed something and the app is doing some stuff due to the test execution from step

    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.xmlis 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.

  3. jakubch1 commented on Jun 20, 2024

    @jakubch1
    Member

    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. ?

  4. sahinM commented on Jun 20, 2024

    @sahinM
    Contributor

    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 😊.

  5. sahinM commented on Jun 21, 2024

    @sahinM
    Contributor

    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.

  6. fhnaseer commented on Jun 21, 2024

    @fhnaseer
    Member

    It seems like coverage file is corrupt. Can you please share what command lines you are executing? And the coverage file?

  7. sahinM commented on Jun 21, 2024

    @sahinM
    Contributor

    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.

  8. carlos2martinize commented on Oct 4, 2024

    @carlos2martinize

    What is private system firewall defender App's for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions