Skip to content

Commit

Permalink
Merge branch 'release/FTP/v2.4.0' into masters/FTP
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandru-petre committed Oct 22, 2024
2 parents 13a96e2 + 23c0f7e commit a18a10e
Show file tree
Hide file tree
Showing 422 changed files with 32,952 additions and 7,710 deletions.
14 changes: 14 additions & 0 deletions Activities/.pipelines/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3.9"
services:
robot:
image: robotdevregistry.azurecr.io/robot/uiautomation-runtime:23.10.81.43986-robot24.4.0-s137
volumes:
- ./mount/input:/input
- ${MOUNT_OUTPUT}:/output
- ./mount/application/EnableOfflineExecution.txt:/application/EnableOfflineExecution.txt
- ./mount/application/NuGet.config:/application/NuGet.config
environment:
OFFLINE: 'true'
LICENSE_AGREEMENT: 'accept'
SQL_SERVER_HOST: ${SQL_SERVER_HOST}
entrypoint: "/bin/sh /input/startup.sh"
Empty file.
21 changes: 21 additions & 0 deletions Activities/.pipelines/docker/mount/application/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- Add this repository to the list of available repositories -->
<add key="Local" value="./Packages" />
<add key="Official" value="https://pkgs.dev.azure.com/uipath/Public.Feeds/_packaging/UiPath-Official/nuget/v3/index.json" />
<add key="Connect" value="https://gallery.uipath.com/api/v3/index.json" />
<add key="UiPath-Internal" value="https://uipath.pkgs.visualstudio.com/Public.Feeds/_packaging/UiPath-Internal/nuget/v3/index.json" />
<add key="nuget-packages" value="https://uipath.pkgs.visualstudio.com/_packaging/nuget-packages/nuget/v3/index.json" />
</packageSources>
<config>
<add key="signatureValidationMode" value="accept" />
</config>
<packageSourceCredentials>
<nuget-packages>
<add key="Username" value="something" />
<add key="ClearTextPassword" value="%NUGET_PACKAGES_PAT%" />
<add key="ValidAuthenticationTypes" value="basic" />
</nuget-packages>
</packageSourceCredentials>
</configuration>
1 change: 1 addition & 0 deletions Activities/.pipelines/docker/mount/input/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# place here things that you want in container
16 changes: 16 additions & 0 deletions Activities/.pipelines/docker/mount/input/UiPath.settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"SecureLicenseKey": "",
"TracingLevel": "Information",
"UiPathServerUrl": "",
"ConnectionString": "",
"ActivitiesFeed": "",
"NuGetApiKey": "",
"NuGetServerUrl": "/home/robotuser/.local/share/UiPath/Packages",
"LowLevelTracing": false,
"LoginToConsole": true,
"ResolutionWidth": 0,
"ResolutionHeight": 0,
"ResolutionDepth": 0,
"FontSmoothing": false,
"UiPathServerUrl": "https://alabala.com/"
}
5 changes: 5 additions & 0 deletions Activities/.pipelines/docker/mount/input/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

mkdir -p /home/robotuser/.local/share/UiPath/
cp -vf /input/UiPath.settings /home/robotuser/.local/share/UiPath/
/application/startup.sh
113 changes: 113 additions & 0 deletions Activities/.pipelines/jobs/stage.build.runtime.tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
parameters:
robotVersion: "23.10.6"
studioProjectPath: ""
buildForWindows: true
buildForPortable: true
packageUnderTestName: ''

jobs:
- job: "BuildRuntimeTests"
displayName: "Build Runtime Tests"
variables:
IntegrationTestStudioPackPath: '$(System.ArtifactsDirectory)/Packages'
timeoutInMinutes: 90
pool:
vmImage: windows-2022
workspace:
clean: outputs | resources | all

steps:
- template: Testing/Automation/install.studio.steps.template.yml@automationTests
parameters:
installType: 'machine'
studioVersion: ${{ parameters.robotVersion }}
license: "7445-1270-1408-6250"
studioCustomNugetFeeds: 'UiPath-Internal,https://uipath.pkgs.visualstudio.com/Public.Feeds/_packaging/UiPath-Internal/nuget/v3/index.json'

- powershell: |
echo "##vso[task.setvariable variable=studioPackagesPath]$env:ProgramFiles/UiPath/Studio/Packages"
& "C:/Program Files/UiPath/Studio/UiRobot.exe" trace --enableLowLevel
displayName: "Enable robot low level"
failOnStderr: false
- task: DownloadPipelineArtifact@2
displayName: "Download Packages"
inputs:
artifact: "Packages"
path: "$(studioPackagesPath)"

- powershell: |
if (Test-Path -Path "$(IntegrationTestStudioPackPath)") {
Remove-Item -Path $(IntegrationTestStudioPackPath) -Force -Recurse
Write-Host "Removed old packages"
}
$packageUnderTest = "${{ parameters.packageUnderTestName }}"
$path = "$(studioPackagesPath)/" + $packageUnderTest + ".*.nupkg"
$file = (Get-Item -Path "$path" | select Name).Name
$null = $file -match '(?<name>[^\d]+)(?<version>.*).nupkg'
$pkgName, $pkgVersion = $Matches['name'].TrimEnd('.'), $Matches['version']
Write-Host "Will build against $pkgName with version $pkgVersion"
mkdir $(IntegrationTestStudioPackPath)
$seconds = ([System.DateTime]::Now - [System.DateTime]::Today).TotalSeconds -as [int]
& "C:/Program Files/UiPath/Studio/UIRobot.exe" --version
Write-Host " "
$projectPath = Join-Path -Path "$(Build.SourcesDirectory)" -ChildPath "${{ parameters.studioProjectPath }}"
Write-Host "Project Path = $projectPath"
$project = (get-content "$projectPath" | ConvertFrom-Json)
$project.name = $project.name.Replace("_portable", "").Replace("_windows", "") + "_portable"
$project.dependencies.$packageUnderTest = "[$pkgVersion]"
if ("${{ parameters.buildForPortable }}" -eq "true") {
Write-Host "Pack for portable " + $project.name
echo $project.name
$project.targetFramework = "Portable"
$project | ConvertTo-JSon | Out-File "$projectPath"
$output = (& "C:/Program Files/UiPath/Studio/UiPath.Studio.CommandLine.exe" publish -p "$projectPath" -f "$(IntegrationTestStudioPackPath)" -v "$env:BUILD_BUILDID.0.$seconds")
if (-Not $output.Contains("Project published successfully."))
{
echo "Sleep 1 minute"
Start-Sleep -Seconds 60
$output = (& "C:/Program Files/UiPath/Studio/UiPath.Studio.CommandLine.exe" publish -p "$projectPath" -f "$(IntegrationTestStudioPackPath)" -v "$env:BUILD_BUILDID.0.$seconds")
if (-Not $output.Contains("Project published successfully."))
{
throw "Pack failed: " + $output
}
}
}
if ("${{ parameters.buildForWindows }}" -eq "true")
{
$project = (get-content "$projectPath" | ConvertFrom-Json)
$project.name = $project.name.Replace("_portable", "").Replace("_windows", "") + "_windows"
Write-Host "Pack for windows " + $project.name
$project.targetFramework = "Windows"
$project | ConvertTo-JSon | Out-File "$projectPath"
$output = (& "C:/Program Files/UiPath/Studio/UiPath.Studio.CommandLine.exe" publish -p "$projectPath" -f "$(IntegrationTestStudioPackPath)" -v "$env:BUILD_BUILDID.0.$seconds")
if (-Not $output.Contains("Project published successfully."))
{
echo "Sleep 1 minute"
Start-Sleep -Seconds 60
$output = (& "C:/Program Files/UiPath/Studio/UiPath.Studio.CommandLine.exe" publish -p "$projectPath" -f "$(IntegrationTestStudioPackPath)" -v "$env:BUILD_BUILDID.0.$seconds")
if (-Not $output.Contains("Project published successfully."))
{
throw "Pack failed: " + $output
}
}
}
displayName: "Pack runtime tests project using UiPath.Studio.CommandLine.exe"
failOnStderr: true
- task: PublishBuildArtifacts@1
displayName: "Publish packed tests"
inputs:
PathToPublish: "$(IntegrationTestStudioPackPath)"
ArtifactName: "Packages"
ArtifactType: "Container"
76 changes: 76 additions & 0 deletions Activities/.pipelines/jobs/stage.run.runtime.tests.portable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
parameters:
robotVersion: ''
beforeTestsCustomSteps: []
afterTestsCustomSteps: []
environment: {}

jobs:
- job: "RunDatabaseRuntimeTestsPortable"
displayName: "Run Database Runtime Tests Portable"
variables:
IntegrationTestStudioPackPath: '$(System.ArtifactsDirectory)/Packages'
timeoutInMinutes: 90
pool:
vmImage: ubuntu-latest
workspace:
clean: outputs | resources | all

steps:
- task: UniversalPackages@0
displayName: "Download TestRunner"
inputs:
command: 'download'
downloadDirectory: "$(Build.ArtifactStagingDirectory)/TestRunner"
vstsFeed: "UiPath-DevPackages"
vstsFeedPackage: "uipath.testrunner"
vstsPackageVersion: $(TestRunnerVersion)
verbosity: 'Trace'

- task: Docker@2
displayName: Login to container registry
inputs:
command: login
containerRegistry: 'robotdevregistry'

- ${{ each step in parameters.beforeTestsCustomSteps }}:
- ${{ step }}

- task: DownloadPipelineArtifact@2
displayName: "Download Packages"
inputs:
artifact: "Packages"
path: "$(IntegrationTestStudioPackPath)"

- bash: |
which docker
docker ps
cp -rvf $(Build.ArtifactStagingDirectory)/TestRunner $(Build.SourcesDirectory)/Activities/.pipelines/docker/mount/input/
cp -vf $(IntegrationTestStudioPackPath)/*nupkg $(Build.SourcesDirectory)/Activities/.pipelines/docker/mount/input/
PACKAGE=$(basename $(ls $(Build.SourcesDirectory)/Activities/.pipelines/docker/mount/input/*_portable*.nupkg))
echo "package = $PACKAGE"
echo "##vso[task.setvariable variable=pkgPath]/input/$PACKAGE"
displayName: 'Prepare tests'
- bash: |
cd $(Build.SourcesDirectory)/Activities/.pipelines/docker
export MOUNT_OUTPUT=$(System.ArtifactsDirectory)
export PATH=/usr/libexec/docker/cli-plugins:$PATH
chmod -R 777 $(System.ArtifactsDirectory)
docker-compose up -d robot
docker-compose exec robot dotnet /input/TestRunner/uipath.studio.codedwf.tests.runner.dll run --package $(pkgPath) --robotPath /application/UiRobot.dll --output /output
displayName: 'Run tests'
env: ${{ parameters.environment }}
- ${{ each step in parameters.afterTestsCustomSteps }}:
- ${{ step }}

- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testRunTitle: "Portable Runtime Tests"
testResultsFiles: '$(System.ArtifactsDirectory)/results*.trx'
publishRunAttachments: true
failTaskOnFailedTests: true
mergeTestResults: true
displayName: 'Publish Tests Results'
condition: always()
103 changes: 103 additions & 0 deletions Activities/.pipelines/jobs/stage.run.runtime.tests.windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
parameters:
robotVersion: ''
beforeTestsCustomSteps: []
afterTestsCustomSteps: []
environment: {}

jobs:
- job: "RunDatabaseRuntimeTestsWindows"
displayName: "Run Database Runtime Tests Windows"
variables:
IntegrationTestStudioPackPath: '$(System.ArtifactsDirectory)/Packages'
StudioProjectPath: 'Activities/Database/UiPath.Database.Runtime.Tests/project.json'
timeoutInMinutes: 90
pool:
vmImage: windows-2022
workspace:
clean: outputs | resources | all

steps:
- task: UniversalPackages@0
displayName: "Download TestRunner"
inputs:
command: 'download'
downloadDirectory: "$(Build.ArtifactStagingDirectory)/TestRunner"
vstsFeed: "UiPath-DevPackages"
vstsFeedPackage: "uipath.testrunner"
vstsPackageVersion: $(TestRunnerVersion)
verbosity: 'Trace'

- task: BuildProcessCleaner@0

- task: ms-autotest.screen-resolution-utility-task.screen-resolution-utlity-task.ScreenResolutionUtility@1
displayName: 'Set Screen Resolution'
inputs:
displaySettings: specific
width: 1920
height: 1080

- task: Docker@2
displayName: Login to container registry
inputs:
command: login
containerRegistry: 'codedwfdemoregistry'

- task: UseDotNet@2
displayName: 'Use .NET SDK 6.0.x'
inputs:
packageType: 'sdk'
version: '6.0.x'

- task: UseDotNet@2
displayName: 'Use .NET SDK 8.0.x'
inputs:
packageType: 'sdk'
version: '8.0.x'

- task: DownloadPipelineArtifact@2
displayName: "Download Packages"
inputs:
artifact: "Packages"
path: "$(IntegrationTestStudioPackPath)"

- ${{ each step in parameters.beforeTestsCustomSteps }}:
- ${{ step }}

# install robot
- template: Testing/Automation/install.msi.steps.template.yml@automationTests
parameters:
installType: 'machine'
msiType: 'robot'
msiVersion: ${{ parameters.robotVersion }}
license: "7445-1270-1408-6250"
installComponents: 'Robot'

- powershell: |
& "C:/Program Files/UiPath/Robot/UiRobot.exe" trace --enableLowLevel
displayName: "Enable robot low level"
failOnStderr: false
- powershell: |
Write-Host "Listing environment"
gci env:* | sort-object name
Write-Host "=============================================================================="
$filepath = Get-ChildItem $(IntegrationTestStudioPackPath)/*_windows*
$fullPath = $filepath.FullName
$env:MOUNT_OUTPUT="$(System.ArtifactsDirectory)"
$(Build.ArtifactStagingDirectory)/TestRunner/uipath.studio.codedwf.tests.runner.exe run --package $fullPath --output $(System.ArtifactsDirectory) --robotPath "C:/Program Files/UiPath/Robot/UiRobot.exe"
displayName: 'Execute tests'
env: ${{ parameters.environment }}
- ${{ each step in parameters.afterTestsCustomSteps }}:
- ${{ step }}

- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testRunTitle: "Windows Runtime Tests"
testResultsFiles: '$(System.ArtifactsDirectory)/results*.trx'
publishRunAttachments: true
failTaskOnFailedTests: true
mergeTestResults: true
displayName: 'Publish Tests Results'
condition: always()
2 changes: 0 additions & 2 deletions Activities/.pipelines/tests/steps/run_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ steps:
- template: run_python2.yml
parameters:
versions:
- "2.7"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
Expand Down
4 changes: 3 additions & 1 deletion Activities/.pipelines/variables/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ variables:
OutputTestsPath: "$(Build.SourcesDirectory)\\Activities\\OutputTests"
RunSettingsFilePath: "$(Build.SourcesDirectory)\\Activities\\CodeCoverage.runsettings"
SolutionsPath: "$(Build.SourcesDirectory)\\Activities"
ToolsPath: "$(Build.SourcesDirectory)\\Activities\\Tools"
ToolsPath: "$(Build.SourcesDirectory)\\Activities\\Tools"
TestRunnerVersion: "1.594.543"
TestsStudioVersion: "23.10.6"
Loading

0 comments on commit a18a10e

Please sign in to comment.