public void GetTestBuildImage_Validate_InvalidTag() { // Arrange var imageBaseValue = string.Empty; var tagSuffixValue = string.Empty; var imageHelper = new ImageTestHelper(_output, imageBaseValue, tagSuffixValue); // Assert Assert.Throws <NotSupportedException>(() => { imageHelper.GetBuildImage("invalidTag"); }); }
public void OutOfTheBox_PlatformToolsSupportedByOryx_ShouldBeChosen_InFullBuildImage( string executableName, string expectedPathPrefix) { // Arrange var script = new ShellScriptBuilder() .AddCommand($"which {executableName}") .ToString(); // Act var image = _imageHelper.GetBuildImage(); var result = _dockerCli.Run(image, "/bin/bash", "-c", script); // Assert RunAsserts( () => { Assert.True(result.IsSuccess); Assert.Contains(expectedPathPrefix, result.StdOut); }, result.GetDebugInfo()); }
public void GetTestBuildImage_Validate_LatestVersionsTag() { // Arrange var imageBaseValue = string.Empty; var tagSuffixValue = string.Empty; var imageHelper = new ImageTestHelper(_output, imageBaseValue, tagSuffixValue); // Act var buildImage = imageHelper.GetBuildImage(_ltsVersionsTag); // Assert var expectedImage = $"{_defaultImageBase}/{_buildRepository}:{_ltsVersionsTag}"; Assert.Equal(expectedImage, buildImage); }
public void GetTestBuildImage_Validate_ImageBaseSet() { // Arrange var imageBaseValue = "oryxtest"; var tagSuffixValue = string.Empty; var imageHelper = new ImageTestHelper(_output, imageBaseValue, tagSuffixValue); // Act var buildImage = imageHelper.GetBuildImage(); // Assert var expectedImage = $"{imageBaseValue}/{_buildRepository}:{_latestTag}"; Assert.Equal(expectedImage, buildImage); }
public void GetTestBuildImage_Validate_TagSuffixSet() { // Arrange var imageBaseValue = string.Empty; var tagSuffixValue = "-buildNumber"; var imageHelper = new ImageTestHelper(_output, imageBaseValue, tagSuffixValue); // Act var buildImage = imageHelper.GetBuildImage(); // Assert var expectedTag = tagSuffixValue.TrimStart('-'); var expectedImage = $"{_defaultImageBase}/{_buildRepository}:{expectedTag}"; Assert.Equal(expectedImage, buildImage); }