-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration tests to run platform builds with architectures IA32, X64 for targets DEBUG, RELEASE for platforms OvmfPkg, ArmVirtPkg, and EmulatorPkg. Signed-off-by: Joey Vagedes <[email protected]>
- Loading branch information
Showing
6 changed files
with
637 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/test | ||
/report | ||
stderr.txt | ||
stdout.txt | ||
/edk2/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
*** Settings *** | ||
Documentation A shared set of common keywords for stuart operations and git operations | ||
# | ||
# Copyright (c), Microsoft Corporation | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
|
||
Library Process | ||
Library OperatingSystem | ||
|
||
# Suite Setup | ||
|
||
*** Variables *** | ||
|
||
#Test output location | ||
${TEST_OUTPUT} ${TEST_OUTPUT_BASE} | ||
|
||
*** Keywords *** | ||
|
||
### Git operations ### | ||
Clone the git repo | ||
[Arguments] ${git_url} ${ws_name} | ||
|
||
Log To console cloning ${git_url} to ${TEST_OUTPUT} | ||
${result}= Run Process git.exe clone ${git_url} ${ws_name} | ||
... cwd=${TEST_OUTPUT} stdout=stdout.txt stderr=stderr.txt | ||
Log Many stdout: ${result.stdout} stderr: ${result.stderr} | ||
|
||
${result}= Run Process git fetch --all --prune | ||
... cwd=${TEST_OUTPUT}${/}${ws_name} stdout=stdout.txt stderr=stderr.txt | ||
Log Many stdout: ${result.stdout} stderr: ${result.stderr} | ||
Should Be Equal As Integers ${result.rc} 0 | ||
|
||
Reset git repo to default branch | ||
[Arguments] ${ws} ${default_branch_name} | ||
|
||
# checkout remote tag for origin/<default branch> | ||
${result}= Run Process git checkout origin/${default_branch_name} | ||
... cwd=${ws} stdout=stdout.txt stderr=stderr.txt | ||
Log Many stdout: ${result.stdout} stderr: ${result.stderr} | ||
Should Be Equal As Integers ${result.rc} 0 | ||
|
||
# clean non ignored files quietly to avoid log overflow | ||
${result}= Run Process git clean -qfd cwd=${ws} | ||
Log Many stdout: ${result.stdout} stderr: ${result.stderr} | ||
Should Be Equal As Integers ${result.rc} 0 | ||
|
||
# reset to restore files | ||
${result}= Run Process git reset --hard | ||
... cwd=${ws} stdout=stdout.txt stderr=stderr.txt | ||
Log Many stdout: ${result.stdout} stderr: ${result.stderr} | ||
Should Be Equal As Integers ${result.rc} 0 | ||
|
||
Get default branch from remote | ||
[Arguments] ${ws} | ||
|
||
# Set origin head to auto | ||
${result}= Run Process git remote set-head origin --auto | ||
... cwd=${ws} | ||
Log Many stdout: ${result.stdout} stderr: ${result.stderr} | ||
Should Be Equal As Integers ${result.rc} 0 | ||
|
||
# get the head | ||
${result}= Run Process git rev-parse --abbrev-ref origin/HEAD | ||
... cwd=${ws} | ||
Log Many stdout: ${result.stdout} stderr: ${result.stderr} | ||
Should Be Equal As Integers ${result.rc} 0 | ||
|
||
# Strip off origin/ from the branch because all other commands | ||
# add the remote name. | ||
${branch}= Get Substring ${result.stdout} 7 | ||
|
||
[Return] ${branch} | ||
|
||
### Stuart operations ### | ||
Stuart setup | ||
[Arguments] ${setting_file} ${arch} ${target} ${packages} ${tool_chain} ${ws} | ||
Log to console Stuart Setup | ||
${result}= Run Process stuart_setup | ||
... -c ${setting_file} -a ${arch} TOOL_CHAIN_TAG\=${tool_chain} -t ${target} -p ${packages} TARGET\=${target} | ||
... cwd=${ws} stdout=stdout.txt stderr=stderr.txt | ||
Log Many stdout: ${result.stdout} stderr: ${result.stderr} | ||
Should Be Equal As Integers ${result.rc} 0 | ||
|
||
Stuart update | ||
[Arguments] ${setting_file} ${arch} ${target} ${packages} ${tool_chain} ${ws} | ||
Log to console Stuart Update | ||
${result}= Run Process stuart_update | ||
... -c ${setting_file} -a ${arch} TOOL_CHAIN_TAG\=${tool_chain} -t ${target} -p ${packages} TARGET\=${target} | ||
... cwd=${ws} stdout=stdout.txt stderr=stderr.txt | ||
Log Many stdout: ${result.stdout} stderr: ${result.stderr} | ||
Should Be Equal As Integers ${result.rc} 0 | ||
|
||
Stuart platform build | ||
[Arguments] ${setting_file} ${arch} ${target} ${tool_chain} ${ws} | ||
Log to console Stuart Build | ||
${result}= Run Process stuart_build | ||
... -c ${setting_file} -a ${arch} TOOL_CHAIN_TAG\=${tool_chain} TARGET\=${target} | ||
... cwd=${ws} stdout=stdout.txt stderr=stderr.txt | ||
Log Many stdout: ${result.stdout} stderr: ${result.stderr} | ||
Should Be Equal As Integers ${result.rc} 0 | ||
|
||
Stuart platform run | ||
[Arguments] ${setting_file} ${arch} ${target} ${tool_chain} ${addtional_flags} ${ws} | ||
Log to console Stuart Build Run | ||
${result}= Run Process stuart_build | ||
... -c ${setting_file} -a ${arch} TOOL_CHAIN_TAG\=${tool_chain} TARGET\=${target} --FlashOnly ${addtional_flags} | ||
... cwd=${ws} stdout=stdout.txt stderr=stderr.txt | ||
Log Many stdout: ${result.stdout} stderr: ${result.stderr} | ||
Should Be Equal As Integers ${result.rc} 0 | ||
|
||
### Edk2 BaseTools Build operations ### | ||
Build BaseTools | ||
[Arguments] ${tool_chain} ${ws} | ||
Log to console Compile basetools | ||
${result}= Run Process python | ||
... BaseTools/Edk2ToolsBuild.py -t ${tool_chain} | ||
... cwd=${ws} shell=True stdout=stdout.txt stderr=stderr.txt | ||
Log Many stdout: ${result.stdout} stderr: ${result.stderr} | ||
Should Be Equal As Integers ${result.rc} 0 |
85 changes: 85 additions & 0 deletions
85
integration_test/azure-pipelines/robot-integration-test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
## | ||
# Azure Pipeline integration test using robot framework | ||
# and edk2 / Project Mu public repositories | ||
# | ||
|
||
# Copyright (c) 2019, Microsoft Corporation | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
## | ||
|
||
jobs: | ||
- job: Integration_Test | ||
|
||
#Use matrix to speed up the build process | ||
strategy: | ||
matrix: | ||
EDK2_VS2019: | ||
Tag: 'VS2019' | ||
Image: 'windows-2019' | ||
EDK2_GCC5: | ||
Tag: 'GCC5' | ||
Image: 'ubuntu-18.04' | ||
|
||
workspace: | ||
clean: all | ||
|
||
pool: | ||
vmImage: $(Image) | ||
|
||
steps: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '3.10.x' | ||
architecture: 'x64' | ||
|
||
- script: pip install --upgrade -r requirements.txt | ||
displayName: 'Install requirements' | ||
|
||
- script: pip install --upgrade -r integration_test/pip-requirements.txt | ||
displayName: 'Install Integration test requirements' | ||
|
||
- script: pip install -e . | ||
displayName: 'Install from Source' | ||
|
||
- powershell: choco install qemu --version=2020.08.14; Write-Host "##vso[task.prependpath]c:\Program Files\qemu" | ||
displayName: Install QEMU and Set QEMU on path # friendly name displayed in the UI | ||
condition: and(contains(variables.Tag, 'AndQemu'), succeeded()) | ||
|
||
- script: git config --global user.email "[email protected]" | ||
displayName: Configure git user user.email | ||
|
||
- script: git config --global user.name "Your Name" | ||
displayName: Configure git user user.name | ||
|
||
- script: python -m robot.run -v TEST_OUTPUT_BASE:$(Build.BinariesDirectory) -d report --xunit xunittestresults.xml --include $(Tag) -L TRACE . | ||
displayName: 'Run Robot Tests' | ||
workingDirectory: "integration_test" | ||
|
||
# Copy the build logs to the artifact staging directory | ||
- task: CopyFiles@2 | ||
displayName: "Copy logs" | ||
inputs: | ||
targetFolder: '$(Build.ArtifactStagingDirectory)' | ||
SourceFolder: 'integration_test/report' | ||
contents: | | ||
log.html | ||
output.xml | ||
report.html | ||
flattenFolders: true | ||
condition: succeededOrFailed() | ||
|
||
# Publish build artifacts to Azure Artifacts/TFS or a file share | ||
- task: PublishBuildArtifacts@1 | ||
continueOnError: true | ||
displayName: "Publish logs" | ||
inputs: | ||
pathtoPublish: '$(Build.ArtifactStagingDirectory)' | ||
artifactName: 'Logs $(System.JobName)' | ||
condition: succeededOrFailed() | ||
|
||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFiles: xunittestresults.xml | ||
searchFolder: 'integration_test/report' | ||
condition: succeededOrFailed() | ||
displayName: 'Publish Test Results' |
Oops, something went wrong.