Visual Studio Remote Testing - Add additional docker run arguments

Johannes Jaeger 0 Reputation points
2023-07-05T11:38:45.64+00:00

I'm using the remote testing feature from Visual Studio to execute my unit tests on a Linux container.

For this, I have the following Dockerfile.test

FROM mcr.microsoft.com/dotnet/sdk:6.0
RUN mkdir /usr/local/temp

RUN wget https://aka.ms/getvsdbgsh && \
sh getvsdbgsh -v latest  -l /vsdbg

And the following testenvironments.json

{
"version": "1",
"environments": [
    {
        "name": "GitServiceUnix",
        "type": "docker",
        "dockerFile": "Dockerfile.test"
    }
]
}

Working fine as it should.

Now I came to the point that I have to mount a volume into the testing container.

  1. Is there any way to add additional docker run arguments like in the Debug Properties?
  2. Is the remote testing also working with a docker-compose file?
  3. Can I build & run the container myself and tell Visual Studio to execute the remote test on this container?
Developer technologies Visual Studio Debugging
Developer technologies Visual Studio Testing
Developer technologies Visual Studio Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2023-07-06T04:02:34.1833333+00:00

    Hi @Johannes Jaeger

    Welcome to Microsoft Q&A! 

    1. Is there any way to add additional docker run arguments like in the Debug Properties?

    It is not supported to add docker run parameters currently. You can vote on this ticket and add your comment. 

    2. Is the remote testing also working with a docker-compose file?

    It is not supported currently. It has been reported to product team. You can track the process.

     

    3. Can I build & run the container myself and tell Visual Studio to execute the remote test on this container?

    You can refer to this similar issue and it might help. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.