Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BuildServerDetector.Detected also set for tests running in Dockerfile? #226

Closed
MEmanuelsson opened this issue May 18, 2021 · 2 comments
Closed
Labels
Milestone

Comments

@MEmanuelsson
Copy link

Is the feature request related to a problem

I recently came across a problem where a Verify test failed in our docker build process (tests being executed as part of our Dockerfile) where it tried to start the diffengine from within the docker daemon (hope I'm using these terms correctly :-)) Setting the environment variable DiffEngine_Disabled in our test when running in docker solves the problem as explained here: https://github.com/VerifyTests/DiffEngine#buildserverdetector. However, I'm wondering if it would be a good idea to also detect if a test run is being executed as part of the docker build in a similar way as I assume is the case for for instance TeamCity, Azure Devops etc and set BuildServerDetector.Detected automatically?

Describe the solution

Not sure if this is even possible or how to go about fixing it but before trying to look for a solution I thought that I'd ask if this is something that's desirable to try to find a solution to before creating a PR for it?

This blog post https://www.hanselman.com/blog/detecting-that-a-net-core-app-is-running-in-a-docker-container-and-skippablefacts-in-xunit mentions an environment variable named DOTNET_RUNNING_IN_CONTAINER, maybe that one is still around to be used?

Describe alternatives considered

The alternative solution to this is most probably to set the DiffEngine_Disabled variable manually but if this is possible to avoid I think it would be a good idea.

@SimonCropp
Copy link
Member

sounds reasonable. i will get to it tomorrow. or u can have a go at a PR

@SimonCropp SimonCropp added this to the 6.8.1 milestone May 19, 2021
@SimonCropp
Copy link
Member

this is now deployed

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

No branches or pull requests

2 participants