Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick changes from ue5-main into v1.x #1203

Merged
merged 3 commits into from
Aug 31, 2023
Merged
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
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
Loading