Fix some Windows docker executor test
What does this MR do?
Move Windows versoin detection into it's own package
Checking what supported Windows version can be reused instead of having
it internal to the helperimage
package. For example inside of tests so
we pick the right image for the test.
Fix Docker Windows tests
Create a new method getBuildForOS
which will get the correct image and
executor for Windows so we don't see errors like:
Error: "executor requires OSType=linux, but Docker Engine supports only OSType=windows"
Not all of the tests are fixed becuase they required more changes, the
main goal of this commit is to fix the ones that require the default
build returned from getBuildForOS
the other tests should be fixed in
follow up commits.
Tests not fixed:
- TestDockerCommandOutput
- TestDockerCommandTwoServicesFromOneImage
- TestDockerCommandWithAllowedImagesRun
- TestDockerCommandUsingCustomClonePath
- TestDockerImageNameFromVariable
- TestCacheInContainer
- TestDockerExtendedConfigurationFromJob
- TestDockerPrivilegedServiceAccessingBuildsFolder
- TestDockerCommandTwoServicesFromOneImage
Why was this MR needed?
To fix tests for steve.exley/gitlab-runner!1 (merged) which is needed for !1569 (merged). This should also be considered part of &888
Are there points in the code the reviewer needs to double check?
Does this MR meet the acceptance criteria?
-
Documentation created/updated -
Added tests for this feature/bug -
In case of conflicts with master
- branch was rebased
What are the relevant issue numbers?
- &888
- Unblock steve.exley/gitlab-runner!1 (merged) for failures like https://gitlab.com/gitlab-org/gitlab-runner/-/jobs/406959641
Edited by Steve Xuereb