In my company we hire engineers for various "disciplines"—iOS, Android, Web, Backend, Data, etc. Engineers follow an onboarding workbook to install what they need for their discipline. iOS engineers need to install Xcode, backend engineers need to install IntelliJ IDEA, etc. And some things are common to all disciplines, such as Homebrew, Git, setting up SSH keys, etc. I should mention that most of us are using MacBook Pros for development.
I'm in somewhat of an experimental team exploring a solution to automate this entire process. In fact the team has already completed a solution for iOS. It is currently "live," i.e. it is now the canonical instruction to follow in the onboarding workbook, and working quite well. We have metrics (e.g. how many seconds people used to spend on various parts of the onboarding workbook) so we can eventually measure the worth of this approach. As well as metrics being fed to Grafana to track where users are running into problems.
Before we extend the solution to other disciplines though, we want to make the solution more robust with tests. The solution itself is in Python. Here's a snippet to give an idea:
if os.path.exists(f"{self.FINAL_XCODE_LOCATION}"):
self.handle_existed_xcode()
self.logger.log(f"Move Xcode.app to {self.FINAL_XCODE_LOCATION}")
os.rename(
f"{pwd}/Xcode.app",
f"{self.FINAL_XCODE_LOCATION}",
)
self.logger.log("Configuring Xcode. It may take some time...")
self.execute_with_log("sudo /usr/sbin/DevToolsSecurity -enable")
self.execute_with_log(
f"sudo xcode-select -s {self.FINAL_XCODE_LOCATION}/Contents"
f"/Developer"
)
self.execute_with_log(
f'sudo DEVELOPER_DIR="{self.FINAL_XCODE_LOCATION}/Contents/Developer" '
f"xcodebuild -license accept"
)
self.execute_with_log(
f'sudo DEVELOPER_DIR="{self.FINAL_XCODE_LOCATION}/Contents/Developer" '
f"xcodebuild -runFirstLaunch"
)
So the big question is, how do we set up for automated testing?
Stepping back, how do we even manually test this? It would be impractical (and error-prone) to uninstall software / reset our own development machines. The 1 engineer working on this—I'm new to the team by the way—has been using VMware to boot up an OSX image. I'm not really familiar with the virtualization space, and I'm getting mixed up thinking about it.
I was reading a general article on VMware vs. Docker that puts it as:
VMware emulates machine hardware whereas Docker emulates the operating system in which your application runs.
I know that we want to support a solution on OSX for both Intel and M1 chips.
If I understand correctly, Docker-OSX can't be the solution—alone, at least—correct? In local testing, it would run on my hardware, i.e. Intel. And if we ran the automated tests on our cloud infrastructure (Kubernetes) as we typically do in our backend build pipelines, well, those things are running Linux containers—so it doesn't work at all, right?
Is the only way to do this to run VMware on a Linux instance in the cloud, that emulates Intel or M1 hardware, and boots up an OSX image?
Or, what would be your approach? (Can be totally different.)