Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -969,12 +969,13 @@ public void CanBuildAndRunNodeApp_WithWorkspace_UsingYarn2ForBuild()
var volume = DockerVolume.CreateMirror(Path.Combine(_hostSamplesDir, "nodejs", appName));
var appOutputDir = "/tmp/nextjs-yarn2-example";
var appDir = volume.ContainerDir;
// Next.js 14 requires Node.js >=18.17.0
var script = new ShellScriptBuilder()
.AddCommand($"cd {appDir}")
.AddCommand($"yarn set version berry")
.AddCommand($"yarn plugin import workspace-tools@2.2.0")
.AddCommand($"yarn set version 2.4.1")
.AddCommand($"oryx build . -o {appOutputDir}")
.AddBuildCommand($". -o {appOutputDir} --platform {NodeConstants.PlatformName} --platform-version {NodeVersions.Node20Version}")
.ToString();

// Act
Expand Down Expand Up @@ -1003,8 +1004,9 @@ public void CanBuildAndRunNodeAppWithoutWorkspace_UsingYarn2ForBuild()
var volume = DockerVolume.CreateMirror(Path.Combine(_hostSamplesDir, "nodejs", appName));
var appOutputDir = "/tmp/nextjs-yarn2-example";
var appDir = volume.ContainerDir;
// Next.js 14 requires Node.js >=18.17.0
var script = new ShellScriptBuilder()
.AddCommand($"oryx build {appDir} -o {appOutputDir}")
.AddBuildCommand($"{appDir} -o {appOutputDir} --platform {NodeConstants.PlatformName} --platform-version {NodeVersions.Node20Version}")
.ToString();

// Act
Expand Down
12 changes: 7 additions & 5 deletions tests/Oryx.BuildImage.Tests/Python/PythonSampleAppsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void PipelineTestInvocationGithubActions()
GeneratesScript_AndBuilds(imageHelper.GetGitHubActionsBuildImage(ImageTestHelperConstants.GitHubActionsBullseye));
JamSpell_CanBe_Installed_In_The_BuildImage(ImageTestHelperConstants.GitHubActionsBullseye);
DoesNotGenerateCondaBuildScript_IfImageDoesNotHaveCondaInstalledInIt(ImageTestHelperConstants.GitHubActionsBullseye);
GeneratesScript_AndBuilds_WithCustomRequirementsTxt(ImageTestHelperConstants.GitHubActionsBullseye);
GeneratesScript_AndBuilds_WithCustomRequirementsTxt(imageHelper.GetGitHubActionsBuildImage(ImageTestHelperConstants.GitHubActionsBullseye));
}

public void GeneratesScript_AndBuilds(string buildImageName)
Expand Down Expand Up @@ -1632,7 +1632,7 @@ public void PythonFastBuildEnabled_UsesUvWithFallback()
() =>
{
Assert.True(result.IsSuccess);
Assert.Contains("PYTHON_FAST_BUILD_ENABLED is set to true, using uv pip with fallback...", result.StdOut);
Assert.Contains("Fast build is enabled", result.StdOut);
Assert.Contains("Installing uv...", result.StdOut);
Assert.Contains("Running uv pip install...", result.StdOut);
},
Expand Down Expand Up @@ -1667,8 +1667,10 @@ public void PythonFastBuildDisabled_UsesPipDirectly()
() =>
{
Assert.True(result.IsSuccess);
Assert.Contains("PYTHON_FAST_BUILD_ENABLED is not enabled, using pip directly...", result.StdOut);
// When PYTHON_FAST_BUILD_ENABLED is not set, the build script uses pip directly
Assert.Contains("Running pip install...", result.StdOut);
// Verify fast build path was not taken - "Fast build is enabled" should not appear
Assert.DoesNotContain("Fast build is enabled", result.StdOut);
Assert.DoesNotContain("Installing uv...", result.StdOut);
},
result.GetDebugInfo());
Expand Down Expand Up @@ -1713,7 +1715,7 @@ public void UvPipInstall_FallsBackToPip_WhenUvFails()
() =>
{
Assert.True(result.IsSuccess);
Assert.Contains("PYTHON_FAST_BUILD_ENABLED is set to true, using uv pip with fallback...", result.StdOut);
Assert.Contains("Fast build is enabled", result.StdOut);
Assert.Contains("Installing uv...", result.StdOut);
Assert.Contains("Running uv pip install...", result.StdOut);
Assert.Contains("falling back to pip install", result.StdOut);
Expand Down Expand Up @@ -1757,7 +1759,7 @@ public void UvPipInstall_UsesPreloadedWheelsDir_WhenProvided()
() =>
{
Assert.True(result.IsSuccess);
Assert.Contains("PYTHON_FAST_BUILD_ENABLED is set to true, using uv pip with fallback...", result.StdOut);
Assert.Contains("Fast build is enabled", result.StdOut);
Assert.Contains($"Using preloaded wheels from: {wheelsDir}", result.StdOut);
Assert.Contains("Running uv pip install...", result.StdOut);
},
Expand Down
Loading