kurtosis-tech / kurtosis-testsuite-starter-pack

The Unlicense
1 stars 1 forks source link

Replace DockerContainerInitializer with a static constructor function, whose methods/configs are populated via a builder #37

Closed mieubrisse closed 3 years ago

mieubrisse commented 3 years ago

The DockerContainerInitializer is getting unwieldy, and it's yet one more interface the user has to implement. I'd like services created via a builder - something like:

ServiceBuilder.new(dockerImage, testVolumeMountpoint, serviceWrappingFunc, startCmdGeneratingFunc)
   .withUsedPorts(usedPortsMap)
   .withGeneratedFiles(mapOfGeneratedFileKeyToInitializationFunc)
   .withFilesArtifacts(mapOfFilesArtifactsToMountpoints)
   .build()

This way, it's very clear what things are required (e.g. testVolumeMountpoint, dockerImage, etc.) and what things are optional, and the average user doesn't need to fuss about the optional stuff.

mieubrisse commented 3 years ago

Dupe of #8