Skip to content

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

@MEmanuelsson

Description

@MEmanuelsson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions