Skip to content

Virtualbox runner with --type gui?

Description

I use Gitlab-CI to test and develop GUI applications. For Linux, I use xvfb-run within a Docker executor. For macOS, I use a dedicated virtual machine with the virtualbox executor (this is running on a physical macOS machine with a display - I use a virtual machine so I can use specific versions of macOS).

I would like to be able to run GUI tests on macOS, primarily "sanity check" tests to ensure that my final generated <Application>.app bundle works and is ready for release.

However I am unable to run such tests under macOS because they require a window server, and the gitlab-runner starts the VM in headless mode. This is hardcoded in helpers/virtualbox/control.go:

func Start(vmName string) error {
	_, err := VBoxManage("startvm", vmName, "--type", "headless")
	return err
}

Proposal

Would it be possible to add the option of running a CI job with the virtualbox using --type gui? I thought that this option could be made available within the [runners.virtualbox] section of the config.tomlfile.

I did a quick proof-of-concept by sneakily replacing the vboxmanage command with my own wrapper script, which replaces --type headless with --type gui. This seems to do exactly what I want. However, I have limited experience in programmatically managing virtualbox machines, so I am unsure as to whether there would be any lifecycle management issues when running machines in gui mode.

Links to related issues and merge requests / references

I could not find any related issues or MRs.