@@ -8,11 +8,33 @@ Write-Host "Root directory: $rootDir"
88ls $rootDir
99
1010# Set the path to test project (.csproj) and runtime settings
11- $testProjectPath = " .\test\Azure.Functions. Cli. Tests\Azure.Functions.Cli.Tests.csproj"
12- $runtimeSettings = " .\test\Azure.Functions. Cli. Tests\E2E\StartTests_artifact_consolidation_visualstudio .runsettings"
11+ $testProjectPath = " .\test\Cli\Func.E2E. Tests\Azure.Functions.Cli.E2E .Tests.csproj"
12+ $runtimeSettings = " .\test\Cli\Func.E2E. Tests\.runsettings\start_tests\artifact_consolidation_pipeline\visualstudio .runsettings"
1313
1414[System.Environment ]::SetEnvironmentVariable(" FUNCTIONS_WORKER_RUNTIME" , " dotnet" , " Process" )
1515
16+ # Path for Visual Studio test projects (convert to absolute paths)
17+ $net8VsProjectPath = " .\test\TestFunctionApps\VisualStudioTestProjects\TestNet8InProcProject"
18+ $net6VsProjectPath = " .\test\TestFunctionApps\VisualStudioTestProjects\TestNet6InProcProject"
19+
20+ # Resolve paths to absolute paths
21+ $absoluteNet8VsProjectPath = (Resolve-Path - Path $net8VsProjectPath - ErrorAction SilentlyContinue).Path
22+ if (-not $absoluteNet8VsProjectPath ) {
23+ $absoluteNet8VsProjectPath = (Join-Path - Path (Get-Location ) - ChildPath $net8VsProjectPath )
24+ Write-Host " Absolute NET8 VS project path (constructed): $absoluteNet8VsProjectPath "
25+ } else {
26+ Write-Host " Absolute NET8 VS project path (resolved): $absoluteNet8VsProjectPath "
27+ }
28+
29+ $absoluteNet6VsProjectPath = (Resolve-Path - Path $net6VsProjectPath - ErrorAction SilentlyContinue).Path
30+ if (-not $absoluteNet6VsProjectPath ) {
31+ $absoluteNet6VsProjectPath = (Join-Path - Path (Get-Location ) - ChildPath $net6VsProjectPath )
32+ Write-Host " Absolute NET6 VS project path (constructed): $absoluteNet6VsProjectPath "
33+ } else {
34+ Write-Host " Absolute NET6 VS project path (resolved): $absoluteNet6VsProjectPath "
35+ }
36+
37+ # Build the test project
1638dotnet build $testProjectPath
1739
1840# Loop through each subdirectory within the parent directory
@@ -30,6 +52,10 @@ Get-ChildItem -Path $StagingDirectory -Directory | ForEach-Object {
3052
3153 # Set the environment variable FUNC_PATH to the func.exe or func path
3254 [System.Environment ]::SetEnvironmentVariable(" FUNC_PATH" , $funcExePath.FullName , " Process" )
55+
56+ # Set the environment variables for test projects - use the absolute paths
57+ [System.Environment ]::SetEnvironmentVariable(" NET8_VS_PROJECT_PATH" , $absoluteNet8VsProjectPath , " Process" )
58+ [System.Environment ]::SetEnvironmentVariable(" NET6_VS_PROJECT_PATH" , $absoluteNet6VsProjectPath , " Process" )
3359
3460 # Run dotnet test with the environment variable set
3561 Write-Host " Running 'dotnet test' on test project: $testProjectPath "
0 commit comments