public async Task DeployModel_GivenAnExistingModel_ShouldDeployModelToDeploymentTargetFolder() { //Arrange var experiment = new Experiment("ExperimentName"); var registeredModel = new RegisteredModel { RunId = Guid.NewGuid(), ExperimentId = experiment.ExperimentId, }; var deploymentTarget = new DeploymentTarget("Test"); await sut.UploadModelAsync(registeredModel.RunId, @"Data/model.txt"); //Act var deployedPath = await sut.DeployModelAsync(deploymentTarget, registeredModel, experiment); //Assert File.Exists(deployedPath).Should().BeTrue(); }
public async Task DeployModel_ShouldReturnCorrectDeploymentPath() { var folderPath = mockFileSystem.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".mlops"); var experiment = new Experiment("ExperimentName"); var registeredModel = new RegisteredModel { RunId = Guid.NewGuid(), }; var deploymentTarget = new DeploymentTarget("Test"); var expectedPath = Path.Combine(folderPath, "deployment", "ExperimentName", "Test", $"{"ExperimentName"}.zip"); var sourcePath = Path.Combine(folderPath, "model-repository", $"{registeredModel.RunId}.zip"); mockFileSystem.AddFile(sourcePath, new MockFileData("test")); // Act var deployedPath = await sut.DeployModelAsync(deploymentTarget, registeredModel, experiment); // Assert deployedPath.Should().Be(expectedPath); }