I am working on a python package that deals with starting containers on demand within tests, for example when you run them on your work station. But can also be bypassed when the tests run in an environment like CircleCI.
And, naturally, I would like to be able to test that package with CircleCI and in particular test the bypass mechanism. But for that, I would need a reliable mean to detect whether I am within a container or a vm environment, from within the build steps. I wished something as simple as reading a environment variable (e.g.
CIRCLE_EXECUTOR_TYPE) but that does not exist.
So I was wondering: what else could I use ? Let me once again insist on the need for the check to be reliable.