Skip to content

Compile gitlab-runner binary for shell integration tests

Arran Walker requested to merge ajwalker/build-runner-test into master

What does this MR do?

The shell executor, during tests, was using the incorrect runner binary.

This change detects when runner is in test mode, and uses a known-path runner location.

The known-path runner location is populated by the init() of a test integration.

An alternative to a known-path location could be to overwrite the runnerCommand variable if it were global. However, due to the shell registration being inside of init(), this is always run first, making such an override difficult.

Why was this MR needed?

Adding further integration tests to the shell executor is problematic if it's using an incorrect helper.

Outside of Docker and Kubernetes, we don't have any integration tests that cover Cache/Artifacts (that rely on such a helper binary). This is a first step towards adding them.

What's the best way to test this MR?

go test -run TestBuildInvokeBinaryHelper ./executors/shell

Running the test without the changes here will always fail.

What are the relevant issue numbers?

#27691 (closed)

Edited by Arran Walker

Merge request reports