Williamhe/1504900 optimize by restructuring test invocation (#1438)

* Update to move ltsversions & jamstack build image into its own job

* Add args parameter

* Add latest build image into its own job

* Update build image tests to run on on a filter

* Add latest image type category to build image tests

* Update verbosity

* Update filter category

* Update filter category in a string

* Update to temporarily remove non-latest build image tests

* Update with backslash

* Update nightly job with latest build image

* Update job name

* Update to enable push build

* Update structure of xunit category tests

* Update structure of pipeline category tests

* Update invocation tag name

* Update to build all debian flavors if no flavor is specified

* Temporarily remove dependency RuntimeImages dependency

* Update tests with corresponding category

* Add vso-focal parallel job

* Update to fix test

* Update to re-add runtime pipeline dependency

* Update to parallelize full, cli, and buildpack images

* Update to parallelize jobs in validation build

* Temporarily remove runtime dependency

* Update to temporarily remove test

* Update to temporarily remove test

* Update to re-add RuntimeImages dependency

* Update cleanup codebase

* Move Fact and Trait in one line

* Minor update

* Remove duplicate functions

* Add loop for BuildImages jobs

* Add key/value pair for handling YAML file naming conventions

* Update naming

* Add other BuildImage dependencies to integration tests

* Upate BuildImage job names

* Upate BuildImage job parameters

* clean up remaining reference to 3.1.419, replacing with newest 3.1 sdk version

* Revert "clean up remaining reference to 3.1.419, replacing with newest 3.1 sdk version"

This reverts commit 2396a29c9c.

* Remove remaining reference to 3.1.419 and replace with a constant

* Remove unnecessary jobs. Using loop instead

* Update to parallelize CI BuildImage Jobs

* Minor update

* Add stage to validation pipeline

* Minor update

* Revert validation pipeline

* Update to loop through jobs for validation

* Temporarily comment out signing restriction for main

* Temporarily comment out signing restriction for main

* Remove unnecessary jobs

* Add more tests

* Update githubactions category

* Remove MemberData parameterization for some test methods

* Remove debianFlavor where it is unnecessary

Co-authored-by: Paul Dorsch <107068277+pauld-msft@users.noreply.github.com>
Co-authored-by: Paul Dorsch <pauldorsch@microsoft.com>
This commit is contained in:
william-msft 2022-06-28 16:00:30 -07:00 коммит произвёл GitHub
Родитель 1fd1845baa
Коммит 900e068ba8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
37 изменённых файлов: 762 добавлений и 427 удалений

Просмотреть файл

@ -473,18 +473,27 @@ if [ -z "$imageTypeToBuild" ]; then
buildFullImage "buster"
elif [ "$imageTypeToBuild" == "githubactions" ]; then
buildGitHubActionsImage
buildGitHubActionsImage "buster"
buildGitHubActionsImage "bullseye"
elif [ "$imageTypeToBuild" == "githubactions-buster" ]; then
buildGitHubActionsImage "buster"
elif [ "$imageTypeToBuild" == "githubactions-bullseye" ]; then
buildGitHubActionsImage "bullseye"
elif [ "$imageTypeToBuild" == "githubactions-stretch" ]; then
buildGitHubActionsImage
elif [ "$imageTypeToBuild" == "jamstack" ]; then
buildJamStackImage
buildJamStackImage "buster"
buildJamStackImage "bullseye"
elif [ "$imageTypeToBuild" == "jamstack-bullseye" ]; then
buildJamStackImage "bullseye"
elif [ "$imageTypeToBuild" == "jamstack-buster" ]; then
buildJamStackImage "buster"
elif [ "$imageTypeToBuild" == "jamstack" ]; then
elif [ "$imageTypeToBuild" == "jamstack-stretch" ]; then
buildJamStackImage
elif [ "$imageTypeToBuild" == "ltsversions" ]; then
buildLtsVersionsImage
buildLtsVersionsImage "buster"
elif [ "$imageTypeToBuild" == "ltsversions-buster" ]; then
buildLtsVersionsImage "buster"
elif [ "$imageTypeToBuild" == "latest" ]; then
@ -495,6 +504,7 @@ elif [ "$imageTypeToBuild" == "vso-focal" ]; then
buildVsoFocalImage
elif [ "$imageTypeToBuild" == "cli" ]; then
buildCliImage
buildCliImage "buster"
elif [ "$imageTypeToBuild" == "cli-buster" ]; then
buildCliImage "buster"
elif [ "$imageTypeToBuild" == "buildpack" ]; then

Просмотреть файл

@ -37,6 +37,13 @@ then
export ORYX_TEST_TAG_SUFFIX="-$3"
fi
if [ -n "$4" ]
then
echo
echo "Setting environment variable 'ORYX_TEST_IMAGE_TYPE' to provided value '$4'."
export ORYX_TEST_IMAGE_TYPE="$4"
fi
echo
echo "Building and running tests..."
cd "$TESTS_SRC_DIR/$testProjectName"
@ -56,6 +63,8 @@ diagnosticFileLocation="$artifactsDir/$testProjectName-log.txt"
dotnet test \
--blame \
--diag "$diagnosticFileLocation" \
--filter "category=${ORYX_TEST_IMAGE_TYPE}" \
--verbosity normal \
--test-adapter-path:. \
--logger:"xunit;LogFilePath=$ARTIFACTS_DIR\testResults\\$testProjectName.xml" \
-c $BUILD_CONFIGURATION

Просмотреть файл

@ -25,7 +25,51 @@ namespace Microsoft.Oryx.BuildImage.Tests
_imageHelper = new ImageTestHelper(output);
}
[Theory]
[Fact, Trait("category", "latest")]
public void PipelineTestInvocationLatest()
{
InstalledNodeModulesExecutablesAreOnPath("latest");
InstalledPythonExecutablesAreOnPath("latest");
var imageTestHelper = new ImageTestHelper();
BuildImagesHaveOryxPathsEnvironmentVariableAvailable(
imageTestHelper.GetBuildImage());
}
[Fact, Trait("category", "ltsversions")]
public void PipelineTestInvocationLtsVersions()
{
InstalledNodeModulesExecutablesAreOnPath("lts-versions");
InstalledPythonExecutablesAreOnPath("lts-versions");
var imageTestHelper = new ImageTestHelper();
BuildImagesHaveOryxPathsEnvironmentVariableAvailable(
imageTestHelper.GetLtsVersionsBuildImage());
}
[Fact, Trait("category", "jamstack")]
public void PipelineTestInvocationJamstack()
{
var imageTestHelper = new ImageTestHelper();
BuildImagesHaveOryxPathsEnvironmentVariableAvailable(
imageTestHelper.GetAzureFunctionsJamStackBuildImage());
}
[Fact, Trait("category", "githubaction")]
public void PipelineTestInvocationGithubActions()
{
var imageTestHelper = new ImageTestHelper();
BuildImagesHaveOryxPathsEnvironmentVariableAvailable(
imageTestHelper.GetGitHubActionsBuildImage());
}
[Fact, Trait("category", "vso-focal")]
public void PipelineTestInvocationVsoFocal()
{
var imageTestHelper = new ImageTestHelper();
BuildImagesHaveOryxPathsEnvironmentVariableAvailable(
imageTestHelper.GetVsoBuildImage("vso-focal"));
}
[Theory, Trait("category", "latest")]
// DotNet
[InlineData("dotnet", "/opt/dotnet/")]
// Node
@ -66,7 +110,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "ltsversions")]
// DotNet
[InlineData("dotnet", "/opt/dotnet/")]
// Node
@ -108,18 +152,18 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[InlineData("dotnet", "vso-focal")]
[InlineData("node", "vso-focal")]
[InlineData("npm", "vso-focal")]
[InlineData("npx", "vso-focal")]
[InlineData("yarn", "vso-focal")]
[InlineData("python", "vso-focal")]
[InlineData("php", "vso-focal")]
[InlineData("ruby", "vso-focal")]
[InlineData("java", "vso-focal")]
[InlineData("mvn", "vso-focal")]
public void UserInstalledExecutable_IsChosenOverOryxExecutable_InVsoBuildImage(string executableName, string debianImageFlavor=null)
[Theory, Trait("category", "vso-focal")]
[InlineData("dotnet")]
[InlineData("node")]
[InlineData("npm")]
[InlineData("npx")]
[InlineData("yarn")]
[InlineData("python")]
[InlineData("php")]
[InlineData("ruby")]
[InlineData("java")]
[InlineData("mvn")]
public void UserInstalledExecutable_IsChosenOverOryxExecutable_InVsoBuildImage(string executableName)
{
// Arrange
var userInstalledExecutable = $"/usr/local/bin/{executableName}";
@ -132,7 +176,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
.ToString();
// Act
var image = _imageHelper.GetVsoBuildImage(debianImageFlavor);
var image = _imageHelper.GetVsoBuildImage("vso-focal");
var result = _dockerCli.Run(image, "/bin/bash", "-c", script);
// Assert
@ -145,11 +189,11 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[InlineData("python3", "/usr/bin/python3", "vso-focal")]
[InlineData("pip", "/usr/local/bin/pip", "vso-focal")]
[InlineData("pip3", "/usr/local/bin/pip3", "vso-focal")]
public void DefaultVersionsOfPythonExecutablesAreUsedInVSOImage(string executableName, string expectedPath, string debianImageFlavor=null)
[Theory, Trait("category", "vso-focal")]
[InlineData("python3", "/usr/bin/python3")]
[InlineData("pip", "/usr/local/bin/pip")]
[InlineData("pip3", "/usr/local/bin/pip3")]
public void DefaultVersionsOfPythonExecutablesAreUsedInVSOImage(string executableName, string expectedPath)
{
// Arrange
var script = new ShellScriptBuilder()
@ -157,7 +201,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
.ToString();
// Act
var image = _imageHelper.GetVsoBuildImage(debianImageFlavor);
var image = _imageHelper.GetVsoBuildImage("vso-focal");
var result = _dockerCli.Run(image, "/bin/bash", "-c", script);
// Assert
@ -170,9 +214,8 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[InlineData("vso-focal")]
public void ExecutableLookUp_FallsBackTo_OryxInstalledVersions_IfNotFoundInEarlierPaths_InVsoImage(string debianImageFlavor)
[Fact, Trait("category", "vso-focal")]
public void ExecutableLookUp_FallsBackTo_OryxInstalledVersions_IfNotFoundInEarlierPaths_InVsoImage()
{
// Arrange
var userInstalledDotNet = "/usr/local/bin/dotnet";
@ -186,7 +229,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
.ToString();
// Act
var image = _imageHelper.GetVsoBuildImage(debianImageFlavor);
var image = _imageHelper.GetVsoBuildImage("vso-focal");
var result = _dockerCli.Run(image, "/bin/bash", "-c", script);
// Assert
@ -200,9 +243,8 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[InlineData("vso-focal")]
public void UserInstalledExecutable_TakesPrecedence_OverEnvironmentSetupByBenv_InVsoBuildImage(string debianImageFlavor=null)
[Fact, Trait("category", "vso-focal")]
public void UserInstalledExecutable_TakesPrecedence_OverEnvironmentSetupByBenv_InVsoBuildImage()
{
// Arrange
var userInstalledDotNet = "/usr/local/bin/dotnet";
@ -218,7 +260,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
.ToString();
// Act
var image = _imageHelper.GetVsoBuildImage(debianImageFlavor);
var image = _imageHelper.GetVsoBuildImage("vso-focal");
var result = _dockerCli.Run(image, "/bin/bash", "-c", script);
// Assert
@ -284,27 +326,11 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
public static TheoryData<string> ImageNameData
private void BuildImagesHaveOryxPathsEnvironmentVariableAvailable(string iamgeName)
{
get
{
var data = new TheoryData<string>();
var imageTestHelper = new ImageTestHelper();
data.Add(imageTestHelper.GetBuildImage());
data.Add(imageTestHelper.GetLtsVersionsBuildImage());
data.Add(imageTestHelper.GetAzureFunctionsJamStackBuildImage());
data.Add(imageTestHelper.GetGitHubActionsBuildImage());
//data.Add(imageTestHelper.GetVsoBuildImage());
//vso image of ubuntu version is tagged as oryx/build:vso-focal
data.Add(imageTestHelper.GetVsoBuildImage("vso-focal"));
return data;
}
// Please note:
// This test method has at least 1 wrapper function that pases the imageName parameter.
}
[Theory]
[MemberData(nameof(ImageNameData))]
public void BuildImagesHaveOryxPathsEnvironmentVariableAvailable(string iamgeName)
{
// Arrange
var expected = "/opt/oryx:";
var script = new ShellScriptBuilder()
@ -324,26 +350,25 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "vso-focal")]
// DotNet
[InlineData("dotnet", "/opt/dotnet/", "vso-focal")]
[InlineData("dotnet", "/opt/dotnet/")]
// Node
[InlineData("node", "/opt/nodejs/", "vso-focal")]
[InlineData("npm", "/opt/nodejs/", "vso-focal")]
[InlineData("npx", "/opt/nodejs/", "vso-focal")]
[InlineData("yarn", "/opt/yarn/", "vso-focal")]
[InlineData("yarnpkg", "/opt/yarn/", "vso-focal")]
[InlineData("node", "/opt/nodejs/")]
[InlineData("npm", "/opt/nodejs/")]
[InlineData("npx", "/opt/nodejs/")]
[InlineData("yarn", "/opt/yarn/")]
[InlineData("yarnpkg", "/opt/yarn/")]
// Python: Note that by default system installed python is available in the path
// Php
[InlineData("php", "/opt/php/", "vso-focal")]
[InlineData("composer.phar", "/opt/php-composer/", "vso-focal")]
[InlineData("php", "/opt/php/")]
[InlineData("composer.phar", "/opt/php-composer/")]
// Java
[InlineData("java", "/opt/java/", "vso-focal")]
[InlineData("mvn", "/opt/maven/", "vso-focal")]
[InlineData("java", "/opt/java/")]
[InlineData("mvn", "/opt/maven/")]
public void OutOfTheBox_SomeToolsAreAvailableInPathOfVSOImage(
string executableName,
string expectedPathPrefix,
string debianImageFlavor=null)
string expectedPathPrefix)
{
// Arrange
var script = new ShellScriptBuilder()
@ -351,7 +376,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
.ToString();
// Act
var image = _imageHelper.GetVsoBuildImage(debianImageFlavor);
var image = _imageHelper.GetVsoBuildImage("vso-focal");
var result = _dockerCli.Run(image, "/bin/bash", "-c", script);
// Assert
@ -364,9 +389,8 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[InlineData("vso-focal")]
public void OutOfTheBox_JavaHomeEnvironmentVarialbeIsSetInVSOImage(string debianImageFlavor)
[Fact, Trait("category", "vso-focal")]
public void OutOfTheBox_JavaHomeEnvironmentVarialbeIsSetInVSOImage()
{
// Arrange
var expectedContent = "JAVA_HOME=/opt/java/lts";
@ -375,7 +399,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
.ToString();
// Act
var image = _imageHelper.GetVsoBuildImage(debianImageFlavor);
var image = _imageHelper.GetVsoBuildImage("vso-focal");
var result = _dockerCli.Run(image, "/bin/bash", "-c", script);
// Assert
@ -388,7 +412,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BenvDotNet22UsesDotNetCore22Version()
{
// Arrange

Просмотреть файл

@ -24,7 +24,7 @@ namespace Oryx.BuildImage.Tests
{
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void DetectCommand_OutputsJsonFormat()
{
// Arrange

Просмотреть файл

@ -21,7 +21,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
public OryxCommandTest(ITestOutputHelper output) : base(output) { }
[Fact]
[Fact, Trait("category", "latest")]
public void Build_ReturnsExpectedErrorCode_ForUnsupportedPlatformException()
{
// Arrange
@ -47,7 +47,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_ReturnsExpectedErrorCode_ForUnsupportedVersionException()
{
// Arrange
@ -73,7 +73,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildImage_Build_UsesCwd_WhenNoSourceDirGiven()
{
// Act
@ -95,7 +95,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact(Skip = "Temporarily skipping test")]
[Fact(Skip = "Temporarily skipping test"), Trait("category", "latest")]
public void BuildImage_CanExec_WithNoUsableToolsDetected()
{
// Arrange
@ -119,7 +119,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildImage_CanExec_SingleCommand()
{
// Arrange
@ -148,7 +148,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact(Skip="Temporarily skipping the test")]
[Fact(Skip="Temporarily skipping the test"), Trait("category", "latest")]
public void BuildImage_CanExec_CommandInSourceDir()
{
// Arrange
@ -178,7 +178,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildImage_CanExec_MultipleCommands_WithOlderToolVersions()
{
// Arrange
@ -217,7 +217,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildImage_Exec_PropagatesFailures()
{
// Arrange

Просмотреть файл

@ -25,7 +25,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
{
public PlatformsCommandTest(ITestOutputHelper output) : base(output) { }
[Fact]
[Fact, Trait("category", "githubactions")]
public void ListsPlatformsAndVersionsAvailableForDynamicInstall()
{
// Arrange

Просмотреть файл

@ -27,7 +27,7 @@ namespace Oryx.BuildImage.Tests
{
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void DetectsAndInstallsPlatformIfNotPresent()
{
// Arrange
@ -58,7 +58,7 @@ namespace Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void DetectsAndInstallsPlatformVersion_SpecifiedByEnvironmentVariable()
{
// Arrange
@ -93,7 +93,7 @@ namespace Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void DetectsAndInstallsPlatformVersion_SpecifiedByBuildEnvFile()
{
// Arrange
@ -128,7 +128,7 @@ namespace Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void SkipsDetectionAndInstallsPlatform()
{
// Arrange
@ -161,7 +161,7 @@ namespace Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void SkipsDetectionAndInstallsPlatformsFromFile()
{
// Arrange
@ -197,7 +197,7 @@ namespace Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void InstallsPlatformAtCustomInstallationRootDirectory()
{
// Arrange
@ -234,7 +234,7 @@ namespace Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void InstallsPlatformsAtBuiltInInstallDirAsRoot()
{
// Arrange

Просмотреть файл

@ -37,7 +37,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
{
}
[Theory]
[Theory, Trait("category", "githubactions")]
[InlineData(NetCoreApp21WebApp, "2.1")]
[InlineData(NetCoreApp31MvcApp, "3.1")]
[InlineData(NetCoreApp50MvcApp, "5.0")]
@ -89,7 +89,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void DynamicInstall_ReInstallsSdk_IfSentinelFileIsNotPresent()
{
// Arrange
@ -143,7 +143,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void BuildsApplication_IgnoresExplicitRuntimeVersionBasedSdkVersion_AndUsesSdkVersionSpecifiedInGlobalJson()
{
// Here we are testing building a 2.1 runtime version app with a 3.1 sdk version
@ -205,7 +205,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void BuildsApplication_IgnoresRuntimeVersionBasedSdkVersion_AndUsesSdkVersionSpecifiedInGlobalJson()
{
// Here we are testing building a 2.1 runtime version app with a 3.1 sdk version
@ -265,7 +265,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void BuildsApplication_UsingPreviewVersionOfSdk()
{
// Arrange
@ -324,7 +324,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void BuildsAppAfterInstallingAllRequiredPlatforms()
{
// Arrange
@ -361,7 +361,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void BuildsApplication_ByDynamicallyInstallingSDKs_IntoCustomDynamicInstallationDir()
{
// Here we are testing building a 2.1 runtime version app with a 3.1 sdk version
@ -424,7 +424,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "vso-focal")]
[InlineData(NetCoreApp30MvcApp, "3.0", DotNetCoreSdkVersions.DotNetCore30SdkVersion)]
public void BuildsApplication_SetLinksCorrectly_ByDynamicallyInstallingSDKs(
string appName,

Просмотреть файл

@ -28,9 +28,36 @@ namespace Microsoft.Oryx.BuildImage.Tests
private DockerVolume CreateSampleAppVolume(string sampleAppName) =>
DockerVolume.CreateMirror(Path.Combine(_hostSamplesDir, "DotNetCore", sampleAppName));
[Fact, Trait("category", "latest")]
public void PipelineTestInvocationLatest()
{
Builds_NetCore21App_UsingNetCore21_DotNetSdkVersion(Settings.BuildImageName);
GDIPlusLibrary_IsPresentInTheImage("latest");
}
[Fact, Trait("category", "ltsversions")]
public void PipelineTestInvocationLtsVersions()
{
Builds_NetCore21App_UsingNetCore21_DotNetSdkVersion(Settings.LtsVersionsBuildImageName);
GDIPlusLibrary_IsPresentInTheImage("lts-versions");
}
[Fact, Trait("category", "vso-focal")]
public void PipelineTestInvocationVsoFocal()
{
GDIPlusLibrary_IsPresentInTheImage("vso-focal");
}
[Fact, Trait("category", "githubactions")]
public void PipelineTestInvocation()
{
GDIPlusLibrary_IsPresentInTheImage("github-actions");
GDIPlusLibrary_IsPresentInTheImage("github-actions-buster");
}
private readonly string SdkVersionMessageFormat = "Using .NET Core SDK Version: {0}";
[Fact (Skip="NetCore11 is no longer officially supported")]
[Fact (Skip="NetCore11 is no longer officially supported"), Trait("category", "latest")]
public void Builds_NetCore10App_UsingNetCore11_DotNetSdkVersion()
{
// Arrange
@ -74,7 +101,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Builds_NetCore11App_UsingNetCore11_DotNetSdkVersion()
{
// Arrange
@ -108,7 +135,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Builds_NetCore20App_UsingNetCore21_DotNetSdkVersion()
{
// Arrange
@ -177,7 +204,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Builds_NetCore22App_UsingNetCore22_DotNetSdkVersion()
{
// Arrange
@ -210,7 +237,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Builds_NetCore30App_UsingNetCore30_DotNetSdkVersion()
{
// Arrange
@ -243,7 +270,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Builds_NetCore31App_UsingNetCore31_DotNetSdkVersion()
{
// Arrange
@ -281,7 +308,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void Builds_NetCore31App_UsingNetCore31_DotNetSdkVersion_CustomError()
{
// Arrange
@ -321,7 +348,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Builds_Net5MvcApp_UsingNet5_DotNetSdkVersion()
{
// Arrange
@ -356,9 +383,8 @@ namespace Microsoft.Oryx.BuildImage.Tests
},
result.GetDebugInfo());
}
// This test is necessary once .NET 6 preview 5 come out.
[Fact]
[Fact, Trait("category", "jamstack")]
public void Builds_Net6BlazorWasmApp_RunsAOTCompilationInstallCommands()
{
// Arrange
@ -392,7 +418,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_ExecutesPreAndPostBuildScripts_WithinBenvContext()
{
// Arrange
@ -457,7 +483,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void Build_CopiesContentCreatedByPreAndPostBuildScript_ToExplicitOutputDirectory()
{
// NOTE: Here we are trying to verify that the pre and post build scripts are able to access the
@ -523,7 +549,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_Executes_InlinePreAndPostBuildCommands()
{
// Arrange
@ -564,7 +590,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_DoesNotClean_DestinationDirectory_ByDefault()
{
// Arrange
@ -600,7 +626,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildsApplication_InIntermediateDirectory_WhenIntermediateDirectorySwitchIsUsed()
{
// Arrange
@ -636,7 +662,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildsMultiWebAppRepoApp_InIntermediateDirectory_WhenIntermediateDirectorySwitchIsUsed()
{
// Arrange
@ -674,7 +700,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Builds_AzureFunctionsProject()
{
// Arrange
@ -709,7 +735,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact(Skip = "Skipping till we fix Bug#1288173")]
[Fact(Skip = "Skipping till we fix Bug#1288173"), Trait("category", "latest")]
public void Builds_SingleBlazorWasmProject_Without_Setting_Apptype_Option()
{
// Arrange
@ -750,7 +776,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Builds_AzureBlazorWasmFunctionProject_By_Setting_Apptype_Via_BuildCommand()
{
// Arrange
@ -789,7 +815,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "jamstack")]
public void Builds_AzureFunctionProject_FromBlazorFunctionRepo_When_Apptype_Is_SetAs_Functions()
{
// Arrange
@ -829,7 +855,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Builds_Application_Checks_OutputType_In_Manifest()
{
// Arrange
@ -866,11 +892,11 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "latest")]
[InlineData(DotNetCoreSdkVersions.DotNetCore21SdkVersion)]
[InlineData(DotNetCoreSdkVersions.DotNetCore22SdkVersion)]
[InlineData(DotNetCoreSdkVersions.DotNetCore30SdkVersion)]
//[InlineData(DotNetCoreSdkVersions.DotNetCore31SdkVersion)]
//[InlineData(DotNetCoreSdkVersions.DotNetCore31SdkVersion), Trait("category", "latest")]
public void DotNetCore_Muxer_ChoosesAppropriateSDKVersion(string sdkversion)
{
// Arrange
@ -905,7 +931,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void Builds_AndCopiesOutput_ToOutputDirectory_NestedUnderSourceDirectory()
{
// Arrange
@ -938,7 +964,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void SubsequentBuilds_CopyOutput_ToOutputDirectory_NestedUnderSourceDirectory()
{
// Arrange
@ -1010,7 +1036,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
/// Tests that a v3 Azure Function app targeting .NET Core 3.1 can be built with the Jamstack image.
/// </summary>
/// <remarks>Find supported Azure Function app target frameworks here: https://docs.microsoft.com/en-us/azure/static-web-apps/apis</remarks>
[Fact]
[Fact, Trait("category", "jamstack")]
public void JamstackImage_CanBuild_NetCore31_V3Functions_apps()
{
// Arrange
@ -1047,7 +1073,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
/// Tests that a v4 Azure Function app targeting .NET 6.0 can be built with the Jamstack image.
/// </summary>
/// <remarks>Find supported Azure Function app target frameworks here: https://docs.microsoft.com/en-us/azure/static-web-apps/apis</remarks>
[Fact]
[Fact, Trait("category", "jamstack")]
public void JamstackImage_CanBuild_Dotnet6_V4Functions_apps()
{
// Arrange
@ -1084,7 +1110,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
/// Tests that a v4 isolated Azure Function app targeting .NET 6 can be built with the Jamstack image.
/// </summary>
/// <remarks>Find supported Azure Function app target frameworks here: https://docs.microsoft.com/en-us/azure/static-web-apps/apis</remarks>
[Fact]
[Fact, Trait("category", "jamstack")]
public void JamstackImage_CanBuild_Dotnet6_Isolated_apps()
{
// Arrange

Просмотреть файл

@ -22,22 +22,25 @@ namespace Microsoft.Oryx.BuildImage.Tests
{
}
public static TheoryData<string> ImageNameData
[Fact, Trait("category", "jamstack")]
public void PipelineTestInvocationJamstack()
{
get
{
var imageTestHelper = new ImageTestHelper();
var data = new TheoryData<string>();
data.Add(imageTestHelper.GetAzureFunctionsJamStackBuildImage());
data.Add(imageTestHelper.GetGitHubActionsBuildImage());
return data;
}
var imageTestHelper = new ImageTestHelper();
InstallsHugoVersionDynamically_UsingEnvironmentVariable_AndBuildsApp(imageTestHelper.GetAzureFunctionsJamStackBuildImage());
}
[Theory]
[MemberData(nameof(ImageNameData))]
public void InstallsHugoVersionDynamically_UsingEnvironmentVariable_AndBuildsApp(string imageName)
[Fact, Trait("category", "githubactions")]
public void PipelineTestInvocationGithubactions()
{
var imageTestHelper = new ImageTestHelper();
InstallsHugoVersionDynamically_UsingEnvironmentVariable_AndBuildsApp(imageTestHelper.GetGitHubActionsBuildImage());
}
private void InstallsHugoVersionDynamically_UsingEnvironmentVariable_AndBuildsApp(string imageName)
{
// Please note:
// This test method has at least 1 wrapper function that pases the imageName parameter.
// Arrange
var hugoVersion = "0.59.1";
var installationDir = $"{BuildScriptGenerator.Constants.TemporaryInstallationDirectoryRoot}/hugo/{hugoVersion}";
@ -73,7 +76,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void DynamicInstall_ReInstallsSdk_IfSentinelFileIsNotPresent()
{
// Arrange
@ -117,7 +120,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildsApplication_ByDynamicallyInstalling_IntoCustomDynamicInstallationDir()
{
// Arrange
@ -160,7 +163,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildsApplication_ByDynamicallyInstallingIntoCustomDynamicInstallationDir()
{
// Arrange
@ -202,7 +205,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
return $"rm -rf {DefaultInstallationRootDir}; mkdir -p {DefaultInstallationRootDir}";
}
[Fact]
[Fact, Trait("category", "jamstack")]
public void JamStackImageHasGoLangInstalled()
{
// Arrange

Просмотреть файл

@ -17,24 +17,37 @@ namespace Microsoft.Oryx.BuildImage.Tests
{
}
public static TheoryData<string> ImageNameData
[Fact, Trait("category", "latest")]
public void PipelineTestInvocationLatest()
{
get
{
var data = new TheoryData<string>();
data.Add(Settings.BuildImageName);
data.Add(Settings.LtsVersionsBuildImageName);
var imageTestHelper = new ImageTestHelper();
data.Add(imageTestHelper.GetAzureFunctionsJamStackBuildImage());
data.Add(imageTestHelper.GetVsoBuildImage());
return data;
}
GeneratesScript_AndBuilds(Settings.BuildImageName);
}
[Theory]
[MemberData(nameof(ImageNameData))]
public void GeneratesScript_AndBuilds(string buildImageName)
[Fact, Trait("category", "ltsversions")]
public void PipelineTestInvocationLtsVersions()
{
GeneratesScript_AndBuilds(Settings.LtsVersionsBuildImageName);
}
[Fact, Trait("category", "vso-focal")]
public void PipelineTestInvocationVsoFocal()
{
var imageTestHelper = new ImageTestHelper();
GeneratesScript_AndBuilds(imageTestHelper.GetVsoBuildImage("vso-focal"));
}
[Fact, Trait("category", "jamstack")]
public void PipelineTestInvocationJamstack()
{
var imageTestHelper = new ImageTestHelper();
GeneratesScript_AndBuilds(imageTestHelper.GetAzureFunctionsJamStackBuildImage());
}
private void GeneratesScript_AndBuilds(string buildImageName)
{
// Please note:
// This test method has at least 1 wrapper function that pases the imageName parameter.
// Arrange
var volume = CreateSampleAppVolume();
var appDir = volume.ContainerDir;
@ -63,7 +76,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "githubactions")]
[InlineData("hugo-sample")]
[InlineData("hugo-sample-json")]
[InlineData("hugo-sample-yaml")]
@ -98,7 +111,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void CanBuildHugoAppHavingPackageJson_ByExplicitlySpecifyingHugoPlatform()
{
// Idea is here that even though the app has a package.json, a user can explicitly choose for Hugo

Просмотреть файл

@ -35,7 +35,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
}
[Theory]
[Theory, Trait("category", "githubactions")]
[MemberData(nameof(VersionsData))]
public void BuildsMavenArcheTypeSampleWithDynamicInstallation(string version)
{

Просмотреть файл

@ -22,7 +22,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
private DockerVolume CreateSampleAppVolume(string sampleAppName) =>
DockerVolume.CreateMirror(Path.Combine(_hostSamplesDir, "java", sampleAppName));
[Fact]
[Fact, Trait("category", "githubactions")]
public void BuildsMavenArcheTypeSample()
{
// Arrange
@ -55,7 +55,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void BuildsMavenJ2EESample()
{
// Arrange
@ -88,7 +88,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void BuildsMavenSimpleJavaApp()
{
// Arrange
@ -121,7 +121,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void BuildsSpringBootSampleApp()
{
// Arrange

Просмотреть файл

@ -22,7 +22,7 @@ namespace Oryx.BuildImage.Tests.Node
{
}
[Theory]
[Theory, Trait("category", "jamstack")]
[InlineData("angularsample", "dist")]
// Temporarily blocking next app as next build is failing accross npm
// [InlineData("blog-starter-nextjs", ".next")]

Просмотреть файл

@ -34,7 +34,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
}
[Theory]
[Theory, Trait("category", "githubactions")]
[MemberData(nameof(ImageNameData))]
public void GeneratesScript_AndBuildNodeAppsWithDynamicInstallation(string version, string buildImageName)
{
@ -70,7 +70,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void DynamicallyInstallsNodeRuntimeAndBuilds()
{
// Arrange
@ -107,7 +107,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void DynamicInstall_ReInstallsSdk_IfSentinelFileIsNotPresent()
{
// Arrange
@ -151,7 +151,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildsApplication_ByDynamicallyInstalling_IntoCustomDynamicInstallationDir()
{
// Arrange

Просмотреть файл

@ -21,7 +21,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
private DockerVolume CreateSampleAppVolume(string sampleAppName) =>
DockerVolume.CreateMirror(Path.Combine(_hostSamplesDir, "nodejs", sampleAppName));
[Fact]
[Fact, Trait("category", "ltsversions")]
public void GeneratesScript_AndBuildMonorepoAppUsingLerna_Npm()
{
// Arrange
@ -58,7 +58,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "vso-focal")]
[InlineData("monorepo-lerna-npm", true)]
[InlineData("monorepo-lerna-yarn", true)]
[InlineData("linxnodeexpress", false)]
@ -101,7 +101,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void GeneratesScript_AndBuildMonorepoAppUsingLerna_Yarn()
{
// Arrange

Просмотреть файл

@ -29,23 +29,30 @@ namespace Microsoft.Oryx.BuildImage.Tests
_tempRootDir = testTempDirTestFixture.RootDirPath;
}
public static TheoryData<string> ImageNameData
[Fact, Trait("category", "latest")]
public void PipelineTestInvocationLatest()
{
get
{
var data = new TheoryData<string>();
data.Add(Settings.BuildImageName);
data.Add(Settings.LtsVersionsBuildImageName);
var imageTestHelper = new ImageTestHelper();
data.Add(imageTestHelper.GetAzureFunctionsJamStackBuildImage());
return data;
}
GeneratesScript_AndBuilds(Settings.BuildImageName);
}
[Theory]
[MemberData(nameof(ImageNameData))]
public void GeneratesScript_AndBuilds(string buildImageName)
[Fact, Trait("category", "ltsversions")]
public void PipelineTestInvocationLtsVersions()
{
GeneratesScript_AndBuilds(Settings.LtsVersionsBuildImageName);
}
[Fact, Trait("category", "jamstack")]
public void PipelineTestInvocationJamstack()
{
var imageTestHelper = new ImageTestHelper();
GeneratesScript_AndBuilds(imageTestHelper.GetAzureFunctionsJamStackBuildImage());
}
private void GeneratesScript_AndBuilds(string buildImageName)
{
// Please note:
// This test method has at least 1 wrapper function that pases the imageName parameter.
// Arrange
var devPackageName = "nodemon";
var prodPackageName = "express";
@ -77,7 +84,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Builds_AndCopiesContentToOutputDirectory_Recursively()
{
// Arrange
@ -114,7 +121,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void Build_CopiesOutput_ToOutputDirectory_NestedUnderSourceDirectory()
{
// Arrange
@ -144,7 +151,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_ReplacesContentInDestinationDir_WhenDestinationDirIsNotEmpty()
{
// Arrange
@ -212,7 +219,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
return script;
}
[Fact(Skip = "structured data is not logged as custom dimension in file, 801985")]
[Fact(Skip = "structured data is not logged as custom dimension in file, 801985"), Trait("category", "latest")]
public void ErrorDetectingNode_FailedExitCode_StringContentFound()
{
var appDir = "/tmp/app1";
@ -246,7 +253,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact(Skip = "structured data is not logged as custom dimension in file, 801985")]
[Fact(Skip = "structured data is not logged as custom dimension in file, 801985"), Trait("category", "latest")]
public void ErrorDetectingNode_FailedExitCode_StringContentNotFound()
{
var appDir = "/tmp/app1";
@ -277,7 +284,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void ErrorDuringBuild_ResultsIn_NonSuccessfulExitCode()
{
// Arrange
@ -308,7 +315,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void GeneratesScript_AndBuilds_WhenExplicitPlatformAndVersion_AreProvided()
{
// Arrange
@ -344,7 +351,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void CanBuild_UsingScriptGeneratedBy_ScriptOnlyOption()
{
// Arrange
@ -379,7 +386,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void CanBuild_UsingScriptGeneratedBy_ScriptOnlyOption_AndWhenExplicitPlatformAndVersion_AreProvided()
{
// Arrange
@ -414,7 +421,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void GeneratesScript_AndBuilds_UsingSuppliedIntermediateDir()
{
// Arrange
@ -445,7 +452,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void GeneratesScriptAndBuilds_WhenSourceAndDestinationFolders_AreSame()
{
// Arrange
@ -475,6 +482,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
[Fact(Skip = "Work item 819489 - output folder as a subdirectory of source is not yet supported.)")]
[Trait("category", "latest")]
public void GeneratesScriptAndBuilds_WhenDestination_IsSubDirectoryOfSource()
{
// Arrange
@ -504,7 +512,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_ExecutesPreAndPostBuildScripts_WithinBenvContext()
{
// Arrange
@ -568,7 +576,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildsNodeApp_AndZipsNodeModules_WithTarGz_IfZipNodeModulesIsTarGz()
{
// NOTE: Use intermediate directory(which here is local to container) to avoid errors like
@ -603,7 +611,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildsNodeApp_AndZipsNodeModules_IfCompressNodeModulesIsZip()
{
// NOTE: Use intermediate directory(which here is local to container) to avoid errors like
@ -641,7 +649,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildsNodeApp_AndDoesNotZipNodeModules_IfZipNodeModulesIsFalse()
{
// Arrange
@ -672,7 +680,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void GeneratesScript_AndBuilds_UsingSuppliedPackageDir()
{
// Arrange
@ -705,7 +713,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void GeneratesScript_AndBuilds_UsingSuppliedPackageDir_WhenPackageDirAndSourceDirAreSame()
{
// Arrange
@ -741,7 +749,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "jamstack")]
public void BuildsNodeApp_AndDoesNotCopyDevDependencies_IfPruneDevDependenciesIsTrue_AndNoProdDependencies()
{
// Arrange
@ -774,7 +782,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "jamstack")]
[InlineData("empty-dependencies")]
[InlineData("no-dependeny-nodes")]
public void BuildsNodeApp_IfPruneDevDependenciesIsTrue_AndNoProd_OrDevDependencies(string appName)
@ -809,7 +817,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "latest")]
[InlineData("webfrontend")]
[InlineData("webfrontend-yarnlock")]
public void BuildsNodeApp_AndDoesNotCopyDevDependencies_IfPruneDevDependenciesIsTrue(string appName)
@ -856,7 +864,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildsNodeApp_DoesNotPruneDevDependencies_IfPruneDevDependenciesIsFalse()
{
// Arrange
@ -901,7 +909,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void BuildsApp_ByRunningCustomBuildCommand_AndSkipNpmInstallCommand()
{
// Arrange
@ -935,7 +943,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void BuildsApp_ByRunningCustomBuildScript_AndSkipNpmInstallCommand()
{
// Arrange
@ -967,7 +975,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void CanBuildAndRunNodeApp_WithWorkspace_UsingYarn2ForBuild()
{
// Arrange
@ -1001,7 +1009,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void CanBuildAndRunNodeAppWithoutWorkspace_UsingYarn2ForBuild()
{
// Arrange
@ -1031,7 +1039,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void BuildsApp_ByRunningNpmInstall_AndCustomRunBuildCommand()
{
// Arrange
@ -1066,7 +1074,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void CanBuildAppHavingAppDynamicsNpmPackage()
{
// Arrange
@ -1102,7 +1110,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void CanBuildAppHavingUsingYarnEngine()
{
// Arrange
@ -1142,7 +1150,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void CanBuildVuePressSampleAppWithPruneDevDependencies()
{
// Arrange

Просмотреть файл

@ -42,7 +42,7 @@ namespace Microsoft.Oryx.BuildImage.Tests.Node
private readonly string[] IgnoredTarEntries = new[] { "package/.npmignore", "package", "package/yarn.lock" };
[Theory(Skip = "Bug# 1361701: In agent this test is failing")]
[Theory(Skip = "Bug# 1361701: In agent this test is failing"), Trait("category", "latest")]
[MemberData(nameof(SomeVSCodeDependencies))]
public void CanBuildNpmPackages(
string pkgName,

Просмотреть файл

@ -50,7 +50,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
}
[Theory]
[Theory, Trait("category", "githubactions")]
[MemberData(nameof(VersionAndImageNameData))]
public void BuildsAppByInstallingSdkDynamically(string phpVersion, string imageName, string phpComposerVersion)
{
@ -89,7 +89,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void BuildsApplication_ByDynamicallyInstalling_IntoCustomDynamicInstallationDir()
{
// Arrange

Просмотреть файл

@ -23,7 +23,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
private DockerVolume CreateSampleAppVolume(string sampleAppName) =>
DockerVolume.CreateMirror(Path.Combine(_hostSamplesDir, "php", sampleAppName));
[Fact]
[Fact, Trait("category", "ltsversions")]
public void GeneratesScript_AndBuilds_TwigExample_InLtsVersionsBuildImage()
{
// Arrange
@ -59,7 +59,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "latest")]
[InlineData(PhpVersions.Php74Version)]
[InlineData(PhpVersions.Php73Version)]
[InlineData(PhpVersions.Php72Version)]
@ -96,7 +96,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "ltsversions")]
[InlineData(PhpVersions.Php74Version)]
[InlineData(PhpVersions.Php73Version)]
[InlineData(PhpVersions.Php72Version)]
@ -139,7 +139,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "ltsversions")]
[InlineData(PhpVersions.Php80Version)]
public void GeneratesScript_AndBuilds_TwigExample_InLtsVersionsBusterImage(string phpVersion)
{

Просмотреть файл

@ -21,7 +21,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
{
}
[Fact]
[Fact, Trait("category", "vso-focal")]
public void CanBuildPythonAppWhichHasJupiterNotebookFile()
{
// Arrange
@ -53,7 +53,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "vso-focal")]
public void CanBuildAppWhichHasCondaEnvironmentYmlFile()
{
// Arrange
@ -89,7 +89,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "vso-focal")]
public void CanBuildPython2AppHavingRequirementsTxtFile()
{
// Arrange
@ -121,7 +121,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "vso-focal")]
public void CanBuildAppWithCondaEnviornmentYmlFileHavingPipPackages()
{
// Arrange
@ -157,7 +157,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "vso-focal")]
public void CanBuildJuliaPythonSampleApp()
{
// Arrange
@ -193,7 +193,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "vso-focal")]
public void CanBuildJupiterRiseApp()
{
// Arrange
@ -229,7 +229,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "vso-focal")]
[InlineData("jupyter-rise")]
public void BuildJupiterCondaApps_Prints_BuildCommands_In_File(string appName)
{

Просмотреть файл

@ -21,26 +21,29 @@ namespace Microsoft.Oryx.BuildImage.Tests
{
}
public static TheoryData<string, string> ImageNameData
[Fact, Trait("category", "ltsversions")]
public void PipelineTestInvocationLtsVersions()
{
get
{
var imageTestHelper = new ImageTestHelper();
var data = new TheoryData<string, string>();
data.Add(imageTestHelper.GetLtsVersionsBuildImage(), "3.8.1");
data.Add(imageTestHelper.GetLtsVersionsBuildImage(), "3.8.3");
data.Add(imageTestHelper.GetGitHubActionsBuildImage(), "3.8.1");
data.Add(imageTestHelper.GetGitHubActionsBuildImage(), "3.8.3");
data.Add(imageTestHelper.GetGitHubActionsBuildImage("github-actions-buster"), "3.9.0");
data.Add(imageTestHelper.GetGitHubActionsBuildImage("github-actions-bullseye"), "3.10.4");
return data;
}
var imageTestHelper = new ImageTestHelper();
GeneratesScript_AndBuildsPython(imageTestHelper.GetLtsVersionsBuildImage(), "3.8.1");
GeneratesScript_AndBuildsPython(imageTestHelper.GetLtsVersionsBuildImage(), "3.8.3");
}
[Theory]
[MemberData(nameof(ImageNameData))]
public void GeneratesScript_AndBuildsPython(string imageName, string version)
[Fact, Trait("category", "githubactions")]
public void PipelineTestInvocationGithubActions()
{
var imageTestHelper = new ImageTestHelper();
GeneratesScript_AndBuildsPython(imageTestHelper.GetGitHubActionsBuildImage(), "3.8.1");
GeneratesScript_AndBuildsPython(imageTestHelper.GetGitHubActionsBuildImage(), "3.8.3");
GeneratesScript_AndBuildsPython(imageTestHelper.GetGitHubActionsBuildImage("github-actions-buster"), "3.9.0");
GeneratesScript_AndBuildsPython(imageTestHelper.GetGitHubActionsBuildImage("github-actions-bullseye"), "3.10.4");
}
private void GeneratesScript_AndBuildsPython(string imageName, string version)
{
// Please note:
// This test method has at least 1 wrapper function that pases the imageName parameter.
// Arrange
var installationDir = $"{BuildScriptGenerator.Constants.TemporaryInstallationDirectoryRoot}/" +
$"python/{version}";
@ -77,7 +80,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "jamstack")]
[InlineData("3.10.4")]
public void GeneratesScript_AndBuildsPython_JamstackBuildImage(string version)
{
@ -116,7 +119,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "githubactions")]
[InlineData("3.8.0b3")]
[InlineData("3.9.0b1")]
public void GeneratesScript_AndBuildsPythonPreviewVersion(string previewVersion)
@ -157,7 +160,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void DynamicInstall_ReInstallsSdk_IfSentinelFileIsNotPresent()
{
// Arrange
@ -200,7 +203,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void BuildsAzureFunctionApp()
{
// Arrange
@ -240,7 +243,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BuildsApplication_ByDynamicallyInstalling_IntoCustomDynamicInstallationDir()
{
// Arrange
@ -282,7 +285,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void GeneratesScript_AndBuilds_WithPackageDir()
{
// Arrange

Просмотреть файл

@ -44,7 +44,19 @@ namespace Microsoft.Oryx.BuildImage.Tests.Python
private readonly string[] IgnoredTarEntries = new[] { "tutorial.rst", "docs/tutorial.rst" };
[Theory]
[Fact, Trait("category", "latest")]
public void PipelineTestInvocationLatest()
{
InstalledPypiFromArtifactFeeds(Settings.BuildImageWithRootAccess);
}
[Fact, Trait("category", "ltsversions")]
public void PipelineTestInvocationLtsVersions()
{
InstalledPypiFromArtifactFeeds(Settings.LtsVersionsBuildImageWithRootAccess);
}
[Theory, Trait("category", "ltsversions")]
[MemberData(nameof(PythonPackageExamples))]
public void CanBuildPython3Packages(
string pkgName,

Просмотреть файл

@ -18,7 +18,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
{
}
[Theory]
[Theory, Trait("category", "latest")]
[MemberData(nameof(TestValueGenerator.GetPythonVersions), MemberType = typeof(TestValueGenerator))]
public void GeneratesScript_AndBuilds_Shapely_With_Python(string version)
{

Просмотреть файл

@ -19,7 +19,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
{
}
[Theory]
[Theory, Trait("category", "latest")]
[InlineData(null)]
[InlineData("false")]
public void GeneratesScript_AndBuilds_DjangoApp_RunningCollectStatic(string disableCollectStatic)

Просмотреть файл

@ -19,7 +19,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
{
}
[Theory]
[Theory, Trait("category", "latest")]
[InlineData("true")]
[InlineData("True")]
public void GeneratesScript_AndBuilds_DjangoApp_WithoutRunningCollectStatic_IfDisableCollectStatic_IsTrue(

Просмотреть файл

@ -27,6 +27,36 @@ namespace Microsoft.Oryx.BuildImage.Tests
_tempDirRootPath = testFixture.RootDirPath;
}
[Fact, Trait("category", "latest")]
public void PipelineTestInvocationLatest()
{
GeneratesScript_AndBuilds(Settings.BuildImageName);
JamSpell_CanBe_Installed_In_The_BuildImage("latest", "2");
JamSpell_CanBe_Installed_In_The_BuildImage("latest", "3");
DoesNotGenerateCondaBuildScript_IfImageDoesNotHaveCondaInstalledInIt("latest");
}
[Fact, Trait("category", "ltsversions")]
public void PipelineTestInvocationLtsVersions()
{
GeneratesScript_AndBuilds(Settings.LtsVersionsBuildImageName);
JamSpell_CanBe_Installed_In_The_BuildImage("lts-versions", "3");
DoesNotGenerateCondaBuildScript_IfImageDoesNotHaveCondaInstalledInIt("lts-versions");
}
[Fact, Trait("category", "vso-focal")]
public void PipelineTestInvocationVsoFocal()
{
JamSpell_CanBe_Installed_In_The_BuildImage("vso-focal", "3");
}
[Fact, Trait("category", "githubactions")]
public void PipelineTestInvocationGithubActions()
{
DoesNotGenerateCondaBuildScript_IfImageDoesNotHaveCondaInstalledInIt("github-actions");
DoesNotGenerateCondaBuildScript_IfImageDoesNotHaveCondaInstalledInIt("github-actions-buster");
}
[Theory]
[InlineData(Settings.BuildImageName)]
[InlineData(Settings.LtsVersionsBuildImageName)]
@ -64,7 +94,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void GeneratesScript_AndLoggerFormatCheck()
{
// Arrange
@ -105,7 +135,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void GeneratesScript_AndBuilds_WithPackageDir()
{
// Arrange
@ -180,7 +210,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Builds_AndCopiesContentToOutputDirectory_Recursively()
{
// Arrange
@ -219,7 +249,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void Build_CopiesOutput_ToOutputDirectory_NestedUnderSourceDirectory()
{
// Arrange
@ -255,7 +285,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void SubsequentBuilds_CopyOutput_ToOutputDirectory_NestedUnderSourceDirectory()
{
// Arrange
@ -294,7 +324,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void GeneratesScriptAndBuilds_WhenSourceAndDestinationFolders_AreSame()
{
// Arrange
@ -327,7 +357,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void GeneratesScriptAndBuilds_WhenDestination_IsSubDirectoryOfSource()
{
// Arrange
@ -361,7 +391,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_DoestNotCleanDestinationDir()
{
// Arrange
@ -402,7 +432,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void ErrorDuringBuild_ResultsIn_NonSuccessfulExitCode()
{
// Try building a Python 2.7 app with 3.7 version. This should fail as there are major
@ -445,7 +475,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void GeneratesScript_AndBuilds_WhenExplicitPlatformAndVersion_AreProvided()
{
// Arrange
@ -492,7 +522,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
// This is to test if we can build an app when there is no requirement.txt
// but setup.py is provided at root level
[Fact]
[Fact, Trait("category", "latest")]
public void GeneratesScript_AndBuilds_WhenSetupDotPy_File_isProvided()
{
// Arrange
@ -536,7 +566,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
// This is to test if we can build an app when both the files requirement.txt
// and setup.py are provided, we tend to prioritize the root level requirement.txt
[Fact]
[Fact, Trait("category", "latest")]
public void GeneratesScript_AndBuilds_With_Both_Files_areProvided()
{
// Arrange
@ -578,7 +608,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact(Skip = "Issue# 1094264")]
[Fact(Skip = "Issue# 1094264"), Trait("category", "latest")]
public void CanBuild_UsingScriptGeneratedBy_ScriptOnlyOption()
{
// Arrange
@ -617,7 +647,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact(Skip = "Issue# 1094264")]
[Fact(Skip = "Issue# 1094264"), Trait("category", "latest")]
public void ThrowsException_ForInvalidPythonVersion()
{
// Arrange
@ -658,7 +688,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact(Skip = "Issue# 1094264")]
[Fact(Skip = "Issue# 1094264"), Trait("category", "latest")]
public void CanBuild_Python2_WithScriptOnlyOption()
{
// Arrange
@ -698,7 +728,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void GeneratesScript_AndBuilds_UsingSuppliedIntermediateDir()
{
// Arrange
@ -737,7 +767,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "vso-focal")]
[InlineData("flask-app", "foo.txt")]
[InlineData("django-realworld-example-app", FilePaths.BuildCommandsFileName)]
public void BuildPythonApps_Prints_BuildCommands_In_File(string appName, string buildCommandsFileName)
@ -776,7 +806,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_VirtualEnv_Unzipped_ByDefault()
{
// Arrange
@ -814,7 +844,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "latest")]
[InlineData(null)]
[InlineData("tar-gz")]
public void Build_CompressesVirtualEnv_InTargGzFormat(string compressionFormat)
@ -856,7 +886,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_CompressesVirtualEnv_InZipFormat()
{
// Arrange
@ -897,7 +927,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_InstallsVirtualEnvironment_AndPackagesInIt()
{
// Arrange
@ -935,7 +965,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_InstallsVirtualEnvironment_AndPackagesInIt_From_File_Setup_Py()
{
// Arrange
@ -973,7 +1003,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_ExecutesPreAndPostBuildScripts_UsingBuildEnvironmentFile()
{
// Arrange
@ -1038,7 +1068,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_ExecutesPreAndPostBuildScripts_UsingEnvironmentVariables()
{
// Arrange
@ -1101,7 +1131,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void PreAndPostBuildScripts_HaveAccessToSourceAndDestinationDirectoryVariables()
{
// Arrange
@ -1160,7 +1190,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Build_Executes_InlinePreAndPostBuildCommands()
{
// Arrange
@ -1203,7 +1233,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void Django_CollectStaticFailure_DoesNotFailBuild()
{
// Arrange
@ -1245,7 +1275,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "latest")]
[InlineData(PythonVersions.Python38Version)]
[InlineData(PythonVersions.Python27Version)]
public void Build_ExecutesPreAndPostBuildScripts_WithinBenvContext(string version)
@ -1319,7 +1349,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void BuildsAppSuccessfully_EvenIfRequirementsTxtOrSetupPyFileDoNotExist()
{
// Arrange
@ -1358,7 +1388,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "githubactions")]
public void BuildsAppAndCompressesOutputDirectory()
{
// Arrange

Просмотреть файл

@ -23,23 +23,29 @@ namespace Microsoft.Oryx.BuildImage.Tests
private DockerVolume CreateSampleAppVolume(string sampleAppName) =>
DockerVolume.CreateMirror(Path.Combine(_hostSamplesDir, "ruby", sampleAppName));
public static TheoryData<string, string> ImageNameData
[Fact, Trait("category", "vso-focal")]
public void PipelineTestInvocationVsoFocal()
{
get
{
var data = new TheoryData<string, string>();
var imageTestHelper = new ImageTestHelper();
data.Add(RubyVersions.Ruby27Version, imageTestHelper.GetVsoBuildImage("vso-focal"));
data.Add(RubyVersions.Ruby30Version, imageTestHelper.GetGitHubActionsBuildImage());
data.Add(RubyVersions.Ruby31Version, imageTestHelper.GetGitHubActionsBuildImage());
return data;
}
var imageTestHelper = new ImageTestHelper();
GeneratesScript_AndBuildSinatraAppWithDynamicInstall(
RubyVersions.Ruby27Version, imageTestHelper.GetVsoBuildImage("vso-focal"));
}
[Theory]
[MemberData(nameof(ImageNameData))]
public void GeneratesScript_AndBuildSinatraAppWithDynamicInstall(string version, string buildImageName)
[Fact, Trait("category", "githubactions")]
public void PipelineTestInvocationGithubActions()
{
var imageTestHelper = new ImageTestHelper();
GeneratesScript_AndBuildSinatraAppWithDynamicInstall(
RubyVersions.Ruby30Version, imageTestHelper.GetGitHubActionsBuildImage());
GeneratesScript_AndBuildSinatraAppWithDynamicInstall(
RubyVersions.Ruby31Version, imageTestHelper.GetGitHubActionsBuildImage());
}
private void GeneratesScript_AndBuildSinatraAppWithDynamicInstall(string version, string buildImageName)
{
// Please note:
// This test method has at least 1 wrapper function that pases the imageName parameter.
// Arrange
var appName = "sinatra-app";
var volume = CreateSampleAppVolume(appName);

Просмотреть файл

@ -23,19 +23,23 @@ namespace Microsoft.Oryx.BuildImage.Tests
private DockerVolume CreateSampleAppVolume(string sampleAppName) =>
DockerVolume.CreateMirror(Path.Combine(_hostSamplesDir, "ruby", sampleAppName));
public static TheoryData<string> ImageNameData
[Fact, Trait("category", "vso-focal")]
public void PipelineTestInvocationVsoFocal()
{
get
{
var data = new TheoryData<string>();
var imageTestHelper = new ImageTestHelper();
data.Add(imageTestHelper.GetAzureFunctionsJamStackBuildImage());
data.Add(imageTestHelper.GetVsoBuildImage("vso-focal"));
return data;
}
var imageTestHelper = new ImageTestHelper();
Builds_JekyllStaticWebApp_UsingCustomBuildCommand(
imageTestHelper.GetVsoBuildImage("vso-focal"));
}
[Fact]
[Fact, Trait("category", "jamstack")]
public void PipelineTestInvocationJamstack()
{
var imageTestHelper = new ImageTestHelper();
Builds_JekyllStaticWebApp_UsingCustomBuildCommand(
imageTestHelper.GetAzureFunctionsJamStackBuildImage());
}
[Fact, Trait("category", "vso-focal")]
public void GeneratesScript_AndBuildSinatraApp()
{
// Arrange
@ -68,7 +72,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "vso-focal")]
public void GeneratesScript_AndBuildRailsApp()
{
// Arrange
@ -102,7 +106,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "vso-focal")]
public void Builds_JekyllStaticWebApp_When_Apptype_Is_SetAs_StaticSiteApplications()
{
// Arrange
@ -132,10 +136,11 @@ namespace Microsoft.Oryx.BuildImage.Tests
});
}
[Theory]
[MemberData(nameof(ImageNameData))]
public void Builds_JekyllStaticWebApp_UsingCustomBuildCommand(string buildImage)
private void Builds_JekyllStaticWebApp_UsingCustomBuildCommand(string buildImage)
{
// Please note:
// This test method has at least 1 wrapper function that pases the imageName parameter.
// Arrange
var appName = "Jekyll-app";
var volume = CreateSampleAppVolume(appName);

Просмотреть файл

@ -20,7 +20,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
{
}
[Fact]
[Fact, Trait("category", "jamstack")]
public void BuildsHugoClientAndDotNetCoreServerApp_WithRecurisveLookupDisabled()
{
// NOTE: This test simulates a typical Azure Static Web Apps repo where the root folder is a static app

Просмотреть файл

@ -29,25 +29,66 @@ namespace Microsoft.Oryx.BuildImage.Tests
_dockerCli = new DockerCli();
}
public static TheoryData<string> ImageNameData
[Fact, Trait("category", "latest")]
public void PipelineTestInvocationLatest()
{
get
{
var data = new TheoryData<string>();
data.Add(Settings.BuildImageName);
data.Add(Settings.LtsVersionsBuildImageName);
var imageTestHelper = new ImageTestHelper();
data.Add(imageTestHelper.GetAzureFunctionsJamStackBuildImage());
data.Add(imageTestHelper.GetGitHubActionsBuildImage());
data.Add(imageTestHelper.GetVsoBuildImage("vso-focal"));
return data;
}
var imageTestHelper = new ImageTestHelper();
PhpAlias_UsesPhpLatestVersion_ByDefault_WhenNoExplicitVersionIsProvided(
imageTestHelper.GetBuildImage());
Python3Alias_UsesPythonLatestVersion_ByDefault_WhenNoExplicitVersionIsProvided(
Settings.BuildImageName);
Node_UsesLTSVersion_ByDefault_WhenNoExplicitVersionIsProvided(
Settings.BuildImageName);
DotNetAlias_UsesLtsVersion_ByDefault(
Settings.BuildImageName);
OryxBuildImage_Contains_VersionAndCommit_Information(Settings.BuildImageName);
}
[SkippableTheory]
[MemberData(nameof(ImageNameData))]
public void OryxBuildImage_Contains_VersionAndCommit_Information(string buildImageName)
[Fact, Trait("category", "ltsversions")]
public void PipelineTestInvocationLtsVersions()
{
var imageTestHelper = new ImageTestHelper();
PhpAlias_UsesPhpLatestVersion_ByDefault_WhenNoExplicitVersionIsProvided(
imageTestHelper.GetLtsVersionsBuildImage());
Python3Alias_UsesPythonLatestVersion_ByDefault_WhenNoExplicitVersionIsProvided(
Settings.LtsVersionsBuildImageName);
Node_UsesLTSVersion_ByDefault_WhenNoExplicitVersionIsProvided(
Settings.LtsVersionsBuildImageName);
DotNetAlias_UsesLtsVersion_ByDefault(Settings.LtsVersionsBuildImageName);
OryxBuildImage_Contains_VersionAndCommit_Information(Settings.LtsVersionsBuildImageName);
}
[Fact, Trait("category", "vso-focal")]
public void PipelineTestInvocationVsoFocal()
{
var imageTestHelper = new ImageTestHelper();
PhpAlias_UsesPhpLatestVersion_ByDefault_WhenNoExplicitVersionIsProvided(
imageTestHelper.GetVsoBuildImage("vso-focal"));
OryxBuildImage_Contains_VersionAndCommit_Information(
imageTestHelper.GetVsoBuildImage("vso-focal"));
}
[Fact, Trait("category", "jamstack")]
public void PipelineTestInvocationJamstack()
{
var imageTestHelper = new ImageTestHelper();
OryxBuildImage_Contains_VersionAndCommit_Information(
imageTestHelper.GetAzureFunctionsJamStackBuildImage());
}
[Fact, Trait("category", "githubactions")]
public void PipelineTestInvocationGithubActions()
{
var imageTestHelper = new ImageTestHelper();
OryxBuildImage_Contains_VersionAndCommit_Information(
imageTestHelper.GetGitHubActionsBuildImage());
}
private void OryxBuildImage_Contains_VersionAndCommit_Information(string buildImageName)
{
// Please note:
// This test method has at least 1 wrapper function that pases the imageName parameter.
// we cant always rely on gitcommitid as env variable in case build context is not correctly passed
// so we should check agent_os environment variable to know if the test is happening in azure devops agent
// or locally, locally we need to skip this test
@ -80,7 +121,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "vso-focal")]
[InlineData("vso-focal")]
public void OryxVsoBuildImage_Contains_PHP_Xdebug(string imageVersion)
{
@ -106,7 +147,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "vso-focal")]
[InlineData("bundler", "vso-focal")]
[InlineData("rake", "vso-focal")]
[InlineData("ruby-debug-ide", "vso-focal")]
@ -162,7 +203,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "latest")]
[InlineData(DotNetCoreSdkVersions.DotNetCore22SdkVersion)]
[InlineData(DotNetCoreSdkVersions.DotNetCore30SdkVersion)]
[InlineData(DotNetCoreSdkVersions.DotNetCore31SdkVersion)]
@ -249,7 +290,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
[Trait("platform", "node")]
[Theory]
[Theory, Trait("category", "latest")]
[InlineData("8.1.4", "v8.1.4")]
[InlineData("8.11", "v8.11.4")]
[InlineData("8.11.4", "v8.11.4")]
@ -298,7 +339,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
[Trait("platform", "node")]
[Theory]
[Theory, Trait("category", "latest")]
// Only version 6 of npm is upgraded, so the following should remain unchanged.
[InlineData("10.1", "5.6.0")]
// Make sure the we get the upgraded version of npm in the following cases
@ -331,7 +372,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void NpmVersion_IsNotUpgraded_To_6_9_0()
{
// Arrange
@ -361,7 +402,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
[Trait("platform", "python")]
[Theory]
[Theory, Trait("category", "latest")]
[InlineData("2", Python27VersionInfo)]
[InlineData("2.7", Python27VersionInfo)]
[InlineData(PythonVersions.Python27Version, Python27VersionInfo)]
@ -394,7 +435,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
[Trait("platform", "python")]
[Theory]
[Theory, Trait("category", "latest")]
[InlineData("2", Python27VersionInfo)]
[InlineData("2.7", Python27VersionInfo)]
[InlineData(PythonVersions.Python27Version, Python27VersionInfo)]
@ -426,7 +467,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
[Trait("platform", "python")]
[Theory]
[Theory, Trait("category", "latest")]
[InlineData("latest", Python38VersionInfo)]
[InlineData("stable", Python38VersionInfo)]
[InlineData("3", Python38VersionInfo)]
@ -464,7 +505,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
[Trait("platform", "dotnet")]
[Theory]
[Theory, Trait("category", "latest")]
[InlineData("DotNet", "dotnet")]
[InlineData("dotnet", "dotNet")]
[InlineData("DOTNET_VERSION", "DOTNET_VERSION")]
@ -502,7 +543,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
[Trait("platform", "dotnet")]
[Fact]
[Fact, Trait("category", "latest")]
public void RunningBenvMultipleTimes_HonorsLastRunArguments()
{
// Arrange
@ -533,23 +574,11 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
public static TheoryData<string> PhpVersionImageNameData
private void PhpAlias_UsesPhpLatestVersion_ByDefault_WhenNoExplicitVersionIsProvided(string buildImageName)
{
get
{
var data = new TheoryData<string>();
data.Add(Settings.BuildImageName);
var imageTestHelper = new ImageTestHelper();
data.Add(imageTestHelper.GetLtsVersionsBuildImage());
data.Add(imageTestHelper.GetVsoBuildImage("vso-focal"));
return data;
}
}
// Please note:
// This test method has at least 1 wrapper function that pases the imageName parameter.
[Theory]
[MemberData(nameof(PhpVersionImageNameData))]
public void PhpAlias_UsesPhpLatestVersion_ByDefault_WhenNoExplicitVersionIsProvided(string buildImageName)
{
// Arrange
var phpVersion = PhpVersions.Php73Version;
if (buildImageName.Contains("oryxdevmcr.azurecr.io/public/oryx/build:vso-focal"))
@ -578,7 +607,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Theory]
[Theory, Trait("category", "latest")]
[InlineData(PhpVersions.Php73Version, PhpVersions.Php73Version)]
[InlineData("7.3", PhpVersions.Php73Version)]
[InlineData("7", PhpVersions.Php73Version)]
@ -610,7 +639,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BenvShouldSetUpEnviroment_WhenMultiplePlatforms_AreSuppliedAsArguments()
{
// Arrange
@ -642,7 +671,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "latest")]
public void BenvShouldSetUpEnviroment_UsingExactNames()
{
// Arrange

Просмотреть файл

@ -36,7 +36,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
}
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void GeneratesScript_AndBuildGolangAppWithDynamicInstall()
{
var imageTestHelper = new ImageTestHelper();
@ -71,7 +71,7 @@ namespace Microsoft.Oryx.BuildImage.Tests
result.GetDebugInfo());
}
[Fact]
[Fact, Trait("category", "ltsversions")]
public void GeneratesScript_AndBuildGolangAppWithoutGoMod()
{
var imageTestHelper = new ImageTestHelper();

Просмотреть файл

@ -1,3 +1,32 @@
parameters:
- name: buildImages
type: object
default:
-
key: Latest
value: latest
-
key: LtsVersions
value: ltsversions
-
key: Jamstack
value: jamstack
-
key: GithubActions
value: githubactions
-
key: VsoFocal
value: vso-focal
-
key: Full
value: full
-
key: Cli
value: cli
-
key: Buildpack
value: buildpack
resources:
- repo: self
@ -77,34 +106,38 @@ stages:
}
displayName: 'Set release tag name as environment variable'
- template: templates/_signBinary.yml
# Job loop for BuildImages
- ${{ each buildImage in parameters.buildImages }}:
- job: Job_BuildImage_${{ buildImage.key }}
displayName: 'Build & Test ${{ buildImage.key }} Build image'
#dependsOn: Job_SignBinaries
condition: succeeded()
timeoutInMinutes: 480
pool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals AzurePipelinesUbuntu20.04compliant
variables:
SignType: $[ dependencies.Job_SignBinaries.outputs['setSignTypeVariable.SignType'] ] # map in the signtype variable
skipComponentGovernanceDetection: true
- job: Job_BuildImage
displayName: Build and Test Build Image
dependsOn: Job_SignBinaries
condition: succeeded()
timeoutInMinutes: 480
pool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals AzurePipelinesUbuntu20.04compliant
variables:
SignType: $[ dependencies.Job_SignBinaries.outputs['setSignTypeVariable.SignType'] ] # map in the signtype variable
skipComponentGovernanceDetection: true
steps:
- script: |
echo "##vso[task.setvariable variable=BuildBuildImages;]true"
echo "##vso[task.setvariable variable=TestBuildImages;]true"
echo "##vso[task.setvariable variable=BuildRuntimeImages;]false"
echo "##vso[task.setvariable variable=TestRuntimeImages;]false"
echo "##vso[task.setvariable variable=PushBuildImages;]true"
echo "##vso[task.setvariable variable=PushRuntimeImages;]false"
echo "##vso[task.setvariable variable=EmbedBuildContextInImages;]true"
displayName: 'Set variables'
steps:
- script: |
echo "##vso[task.setvariable variable=BuildBuildImages;]true"
echo "##vso[task.setvariable variable=TestBuildImages;]true"
echo "##vso[task.setvariable variable=BuildRuntimeImages;]false"
echo "##vso[task.setvariable variable=TestRuntimeImages;]false"
echo "##vso[task.setvariable variable=PushBuildImages;]true"
echo "##vso[task.setvariable variable=PushRuntimeImages;]false"
echo "##vso[task.setvariable variable=EmbedBuildContextInImages;]true"
displayName: 'Set variables'
- template: templates/_setReleaseTag.yml
- template: templates/_setReleaseTag.yml
- template: templates/_buildTemplate.yml
- template: templates/_buildTemplate.yml
parameters:
imageType: ${{ buildImage.value }}
- job: Job_RuntimeImages
displayName: Build and Test Runtime Images

Просмотреть файл

@ -1,3 +1,32 @@
parameters:
- name: buildImages
type: object
default:
-
key: Latest
value: latest
-
key: LtsVersions
value: ltsversions
-
key: Jamstack
value: jamstack
-
key: GithubActions
value: githubactions
-
key: VsoFocal
value: vso-focal
-
key: Full
value: full
-
key: Cli
value: cli
-
key: Buildpack
value: buildpack
resources:
- repo: self
fetchDepth: 15
@ -32,6 +61,7 @@ stages:
inputs:
targetPath: $(Build.SourcesDirectory)/artifacts/releaseTag.txt
artifactName: releaseTag
- stage: Build
displayName: Build Stage
jobs:
@ -43,26 +73,30 @@ stages:
vmImage: windows-2022
steps:
- template: templates/_securityChecks.yml
- job: Job_BuildImage
displayName: Build and Test Build Image
timeoutInMinutes: 480
pool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals AzurePipelinesUbuntu20.04compliant
steps:
- script: |
echo "##vso[task.setvariable variable=BuildBuildImages;]true"
echo "##vso[task.setvariable variable=TestBuildImages;]true"
echo "##vso[task.setvariable variable=BuildRuntimeImages;]false"
echo "##vso[task.setvariable variable=TestRuntimeImages;]false"
echo "##vso[task.setvariable variable=PushBuildImages;]true"
echo "##vso[task.setvariable variable=PushRuntimeImages;]false"
echo "##vso[task.setvariable variable=EmbedBuildContextInImages;]true"
echo "##vso[task.setvariable variable=RELEASE_TAG_NAME;]$(Build.BuildNumber)"
displayName: 'Set variables'
- template: templates/_buildTemplate.yml
# Job loop for BuildImages
- ${{ each buildImage in parameters.buildImages }}:
- job: Job_BuildImage_${{ buildImage.key }}
displayName: 'Build & Test ${{ buildImage.key }} Build image'
pool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals AzurePipelinesUbuntu20.04compliant
timeoutInMinutes: 480
steps:
- script: |
echo "##vso[task.setvariable variable=BuildBuildImages;]true"
echo "##vso[task.setvariable variable=TestBuildImages;]true"
echo "##vso[task.setvariable variable=BuildRuntimeImages;]false"
echo "##vso[task.setvariable variable=TestRuntimeImages;]false"
echo "##vso[task.setvariable variable=PushBuildImages;]true"
echo "##vso[task.setvariable variable=PushRuntimeImages;]false"
echo "##vso[task.setvariable variable=EmbedBuildContextInImages;]true"
echo "##vso[task.setvariable variable=RELEASE_TAG_NAME;]$(Build.BuildNumber)"
displayName: 'Set variables'
- template: templates/_buildTemplate.yml
parameters:
imageType: ${{ buildImage.value }}
- job: Job_RuntimeImages
displayName: Build and Test Runtime Images

Просмотреть файл

@ -2,6 +2,7 @@ parameters:
ascName: oryxSP
acrName: oryxdevmcr.azurecr.io
imageName: oryxdevmcr.azurecr.io/public/oryx
imageType: null
steps:
- script: |
@ -85,6 +86,7 @@ steps:
displayName: 'Build build images'
inputs:
scriptPath: ./build/buildBuildImages.sh
args: -t ${{ parameters.imageType }}
condition: and(succeeded(), eq(variables['BuildBuildImages'], 'true'))
- task: ShellScript@2
@ -128,7 +130,7 @@ steps:
displayName: 'Test build images'
inputs:
scriptPath: ./build/testBuildImages.sh
args: skipBuildingImages ${{ parameters.imageName }} $(Build.DefinitionName).$(RELEASE_TAG_NAME)
args: skipBuildingImages ${{ parameters.imageName }} $(Build.DefinitionName).$(RELEASE_TAG_NAME) ${{ parameters.imageType }}
condition: and(succeeded(), eq(variables['TestBuildImages'], 'true'))
- task: ShellScript@2

Просмотреть файл

@ -39,7 +39,14 @@ jobs:
- job: Job_PythonIntegrationTests
displayName: Run Python Integration Tests
dependsOn:
- Job_BuildImage
- Job_BuildImage_Latest
- Job_BuildImage_LtsVersions
- Job_BuildImage_Jamstack
- Job_BuildImage_GithubActions
- Job_BuildImage_VsoFocal
- Job_BuildImage_Full
- Job_BuildImage_Cli
- Job_BuildImage_Buildpack
- Job_RuntimeImages
pool:
name: AzurePipelines-EO
@ -68,8 +75,15 @@ jobs:
- job:
displayName: 'Run DotNetCore ${{ dotNetCoreVersion }} Integration Tests'
dependsOn:
- Job_BuildImage
- Job_RuntimeImages
- Job_BuildImage_Latest
- Job_BuildImage_LtsVersions
- Job_BuildImage_Jamstack
- Job_BuildImage_GithubActions
- Job_BuildImage_VsoFocal
- Job_BuildImage_Full
- Job_BuildImage_Cli
- Job_BuildImage_Buildpack
- Job_RuntimeImages
pool:
name: AzurePipelines-EO
demands:
@ -97,8 +111,15 @@ jobs:
- job:
displayName: 'Run Node ${{ nodeVersion }} Integration Tests'
dependsOn:
- Job_BuildImage
- Job_RuntimeImages
- Job_BuildImage_Latest
- Job_BuildImage_LtsVersions
- Job_BuildImage_Jamstack
- Job_BuildImage_GithubActions
- Job_BuildImage_VsoFocal
- Job_BuildImage_Full
- Job_BuildImage_Cli
- Job_BuildImage_Buildpack
- Job_RuntimeImages
pool:
name: AzurePipelines-EO
demands:
@ -126,8 +147,15 @@ jobs:
- job:
displayName: 'Run Golang ${{ golangVersion }} Integration Tests'
dependsOn:
- Job_BuildImage
- Job_RuntimeImages
- Job_BuildImage_Latest
- Job_BuildImage_LtsVersions
- Job_BuildImage_Jamstack
- Job_BuildImage_GithubActions
- Job_BuildImage_VsoFocal
- Job_BuildImage_Full
- Job_BuildImage_Cli
- Job_BuildImage_Buildpack
- Job_RuntimeImages
pool:
name: AzurePipelines-EO
demands:
@ -153,7 +181,14 @@ jobs:
- job: Job_PhpIntegrationTests8_0
displayName: Run Php Integration Tests 8.0
dependsOn:
- Job_BuildImage
- Job_BuildImage_Latest
- Job_BuildImage_LtsVersions
- Job_BuildImage_Jamstack
- Job_BuildImage_GithubActions
- Job_BuildImage_VsoFocal
- Job_BuildImage_Full
- Job_BuildImage_Cli
- Job_BuildImage_Buildpack
- Job_RuntimeImages
pool:
name: AzurePipelines-EO
@ -180,7 +215,14 @@ jobs:
- job: Job_PhpIntegrationTests7_4
displayName: Run Php Integration Tests 7.4
dependsOn:
- Job_BuildImage
- Job_BuildImage_Latest
- Job_BuildImage_LtsVersions
- Job_BuildImage_Jamstack
- Job_BuildImage_GithubActions
- Job_BuildImage_VsoFocal
- Job_BuildImage_Full
- Job_BuildImage_Cli
- Job_BuildImage_Buildpack
- Job_RuntimeImages
pool:
name: AzurePipelines-EO
@ -207,7 +249,14 @@ jobs:
- job: Job_RubyIntegrationTests
displayName: Run Ruby Integration Tests
dependsOn:
- Job_BuildImage
- Job_BuildImage_Latest
- Job_BuildImage_LtsVersions
- Job_BuildImage_Jamstack
- Job_BuildImage_GithubActions
- Job_BuildImage_VsoFocal
- Job_BuildImage_Full
- Job_BuildImage_Cli
- Job_BuildImage_Buildpack
- Job_RuntimeImages
pool:
name: AzurePipelines-EO
@ -234,7 +283,14 @@ jobs:
- job: Job_DbIntegrationTests
displayName: Run Database Integration Tests
dependsOn:
- Job_BuildImage
- Job_BuildImage_Latest
- Job_BuildImage_LtsVersions
- Job_BuildImage_Jamstack
- Job_BuildImage_GithubActions
- Job_BuildImage_VsoFocal
- Job_BuildImage_Full
- Job_BuildImage_Cli
- Job_BuildImage_Buildpack
- Job_RuntimeImages
pool:
name: AzurePipelines-EO

Просмотреть файл

@ -1,3 +1,32 @@
parameters:
- name: buildImages
type: object
default:
-
key: Latest
value: latest
-
key: LtsVersions
value: ltsversions
-
key: Jamstack
value: jamstack
-
key: GithubActions
value: githubactions
-
key: VsoFocal
value: vso-focal
-
key: Full
value: full
-
key: Cli
value: cli
-
key: Buildpack
value: buildpack
resources:
- repo: self
fetchDepth: 15
@ -15,23 +44,26 @@ jobs:
steps:
- template: templates/_securityChecks.yml
- job: Job_BuildImage
displayName: Build and Test Build Images
pool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals AzurePipelinesUbuntu20.04compliant
timeoutInMinutes: 480
steps:
- script: |
echo "##vso[task.setvariable variable=BuildBuildImages;]true"
echo "##vso[task.setvariable variable=TestBuildImages;]true"
echo "##vso[task.setvariable variable=PushBuildImages;]false"
echo "##vso[task.setvariable variable=PushRuntimeImages;]false"
echo "##vso[task.setvariable variable=EmbedBuildContextInImages;]true"
echo "##vso[task.setvariable variable=RELEASE_TAG_NAME;]$(Build.BuildNumber)"
displayName: 'Set variables'
- template: templates/_buildTemplate.yml
- ${{ each buildImage in parameters.buildImages }}:
- job: Job_BuildImage_${{ buildImage.key }}
displayName: Build and Test Build ${{ buildImage.key }} Image
pool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals AzurePipelinesUbuntu20.04compliant
timeoutInMinutes: 480
steps:
- script: |
echo "##vso[task.setvariable variable=BuildBuildImages;]true"
echo "##vso[task.setvariable variable=TestBuildImages;]true"
echo "##vso[task.setvariable variable=PushBuildImages;]false"
echo "##vso[task.setvariable variable=PushRuntimeImages;]false"
echo "##vso[task.setvariable variable=EmbedBuildContextInImages;]true"
echo "##vso[task.setvariable variable=RELEASE_TAG_NAME;]$(Build.BuildNumber)"
displayName: 'Set variables'
- template: templates/_buildTemplate.yml
parameters:
imageType: ${{ buildImage.value }}
- job: Job_RuntimeImages
displayName: Build and Test Runtime Images