Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor VirtualMachineManager #808

Open
aionick opened this issue Feb 5, 2019 · 0 comments
Open

Refactor VirtualMachineManager #808

aionick opened this issue Feb 5, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@aionick
Copy link
Contributor

aionick commented Feb 5, 2019

The reason this is an interface is so that we can have one official production implementation (which is VmFactoryImplementation - perhaps better naming is needed to get these more in sync) and still have the ability to create mock VirtualMachineManager instances for unit (and even integ) tests to contrive certain behaviours.

Currently VirtualMachineManager depends on VM, which is defined in its child. Actually VM should probably just be moved out of the child, since even mocked implementations will require this same VM behaviour.

There is a third class, VirtualMachineProvider, which acts as an arbitrary provider of VirtualMachineManager implementations. By default, the production VmFactoryImplementation is used, but there is an ability to set this manager so that tests can inject a mocked implementation into the BulkExecution via this path.

VirtualMachineProvider is what's used by the BulkExecutor to grab a virtual machine, and this is also the class that Aion uses at bootup to initialize and shutdown the virtual machines.

Aside from moving VM into its own class and some re-naming, we probably also want to ensure that this model makes sense.. there may be a much cleaner way of being able to inject mocked & production implementations into the bulk executor.

@aionick aionick added the enhancement New feature or request label Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant