Skip to content

Commit

Permalink
Merge pull request #1203 from CesiumGS/1x-changes-from-main
Browse files Browse the repository at this point in the history
Cherry-pick changes from ue5-main into v1.x
  • Loading branch information
kring authored Aug 31, 2023
2 parents dbbca15 + e58ecd8 commit 8200fa5
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 26 deletions.
85 changes: 60 additions & 25 deletions .github/workflows/testWindows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,48 +61,83 @@ jobs:
dir
Get-Content "CesiumForUnreal.uplugin" | select-string -pattern "EngineVersion"
- name: Run Cesium tests
continue-on-error: true
timeout-minutes: 30
timeout-minutes: 60
run: |
cd "${{ inputs.unreal-binaries-path }}"
./UnrealEditor-Cmd.exe "$env:TESTS_PROJECT_ROOT/TestsProject.uproject" -execcmds="Automation RunTests Cesium.;quit" -nullrhi -unattended -nosplash -ReportExportPath="$env:TESTS_PROJECT_LOGS"
- name: Display tests log
if: always()
run: |
cd "$env:TESTS_PROJECT_LOGS"
dir
Get-Content TestsProject.log
- name: Display tests report
if: always()
run: |
cd "$env:TESTS_PROJECT_LOGS"
Get-Content index.json
- name: Evaluate tests results
if: always()
run: |
$env:TEST_STATUS="Pending"
echo "test_status=$env:TEST_STATUS" >> $env:GITHUB_ENV
cd "$env:TESTS_PROJECT_LOGS"
# Define function to parse json recursively
function Parse-JsonRecursively($jsonObject) {
foreach ($property in $jsonObject.PSObject.Properties) {
$name = $property.Name
$value = $property.Value
$failedTests = ""
$succeededTests = ""
function Parse-Test($jsonObject) {
$currTestName = ""
foreach ($property in $jsonObject.PSObject.Properties) {
$name = $property.Name
$value = $property.Value
if($name -eq "fullTestPath") {
$currTestName = $value
}
if($name -eq "state") {
if ($value -eq "Success") {
$global:succeededTests += $currTestName + "`n"
}
else {
$global:failedTests += $currTestName + "`n"
}
}
}
}
function Parse-Json($jsonObject) {
foreach ($property in $jsonObject.PSObject.Properties) {
$name = $property.Name
$value = $property.Value
# If the property value is another object, call function recursively
if ($value -is [PSCustomObject]) {
Parse-JsonRecursively($value)
}
else {
# If "state:fail" entry is found in json, set failure state
if($name -eq "state" -and $value -eq "fail") {
$env:TEST_STATUS="Failure"
return
}
}
}
# If the property value is another object, call function recursively
if ($name -eq "tests" -and $value -is [System.Object[]]) {
for (($i = 0); $i -lt $value.Count; $i++) {
Parse-Test($value[$i])
}
}
}
}
$env:TEST_STATUS="Success" # Set status to success at start
$json = Get-Content -Path 'index.json' | ConvertFrom-Json # Read in json
Parse-JsonRecursively -jsonObject $json # Parse json
echo "test_status=$env:TEST_STATUS" >> $env:GITHUB_ENV # Export result to github environment variables
Parse-Json -jsonObject $json # Parse json
echo " "
if ($failedTests.Length -eq 0) {
echo "All tests passed:"
echo "-----------------"
echo "$succeededTests"
exit 0
}
else {
echo "Passing tests:"
echo "--------------"
echo "$succeededTests"
echo "FAILED tests:"
echo "-------------"
echo "$failedTests"
exit -1
}
2 changes: 1 addition & 1 deletion Documentation/developer-setup-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Or the debug version:
## CMake command-line for Android
To cross-compile Cesium Native for Android, ensure that you have [installed Android Studio and Android NDK, and configured ANDROID_NDK_ROOT](https://github.com/CesiumGS/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#for-cross-compiling-android-on-windows). Then you will need to have Ninja installed. With [chocolatey](https://chocolatey.org/install), you can run:
To cross-compile Cesium Native for Android, ensure that you have [installed Android Studio and Android NDK, and configured ANDROID_NDK_ROOT](#to-cross-compile-android-on-windows). Then you will need to have Ninja installed. With [chocolatey](https://chocolatey.org/install), you can run:
choco install ninja
Expand Down

0 comments on commit 8200fa5

Please sign in to comment.