Skip to content

Commit

Permalink
Record XrSim tests for the composition layer and passthrough sample p…
Browse files Browse the repository at this point in the history
…rojects
  • Loading branch information
dsnopek committed Jun 20, 2024
1 parent 55338d7 commit a573e82
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions .github/workflows/build-addon-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ jobs:
runs-on: [Windows, self-hosted, gpu]
needs: build

env:
GODOT_VERSION: "4.3-beta1"
XRSIM_VERSION: "65.0.0"

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -207,7 +211,7 @@ jobs:
- name: Download Godot
run: |
# @todo Download an actual Godot build!
Invoke-WebRequest -Uri "https://github.com/godotengine/godot-builds/releases/download/4.3-beta1/Godot_v4.3-beta1_win64.exe.zip" -OutFile "godot.zip"
Invoke-WebRequest -Uri "https://github.com/godotengine/godot-builds/releases/download/${{ env.GODOT_VERSION }}/Godot_v${{ env.GODOT_VERSION }}_win64.exe.zip" -OutFile "godot.zip"
- name: Extract Godot
run: |
Expand All @@ -219,7 +223,7 @@ jobs:

- name: Download Meta XR Simulator
run: |
Invoke-WebRequest -Uri "https://npm.developer.oculus.com/com.meta.xr.simulator/-/com.meta.xr.simulator-65.0.0.tgz" -OutFile MetaXRSimulator.tgz
Invoke-WebRequest -Uri "https://npm.developer.oculus.com/com.meta.xr.simulator/-/com.meta.xr.simulator-${{ env.XRSIM_VERSION }}.tgz" -OutFile MetaXRSimulator.tgz
- name: Extract Meta XR Simulator
run: |
Expand Down Expand Up @@ -252,11 +256,16 @@ jobs:
mkdir -p demo/addons/godotopenxrvendors/.bin/windows/
cp -r build-files-windows/* demo/addons/godotopenxrvendors/.bin/windows/
- name: Import the demo project
- name: Import the demo and sample projects
run: |
$godot = "Godot_v4.3-beta1_win64.exe"
$godot = "Godot_v${{ env.GODOT_VERSION }}_win64.exe"
Start-Process -FilePath "$godot" -ArgumentList "--path demo --import --headless" -NoNewWindow -Wait
$sampleProjects = Get-ChildItem -Path "samples/" -Directory
foreach ($project in $sampleProjects) {
Start-Process -FilePath "$godot" -ArgumentList "--path $($project.FullName) --import --headless" -NoNewWindow -Wait
}
- name: Launch a synthetic environment
run: |
# Ensure a synthetic environment isn't already running.
Expand All @@ -272,7 +281,12 @@ jobs:
run: |
$jsonPath = "$env:AppData\MetaXR\MetaXrSimulator\persistent_data.json"
$vrsFiles = Get-ChildItem -Path tests/vrs -Filter *.vrs
$demoVrsFiles = Get-ChildItem -Path "demo/tests/" -Recurse -Filter *.vrs
$sampleVrsFiles = Get-ChildItem -Path "samples/*/tests/" -Recurse -Filter *.vrs
$vrsFiles = @()
$vrsFiles += $demoVrsFiles
$vrsFiles += $sampleVrsFiles
foreach ($file in $vrsFiles) {
$replayPath = Join-Path -Path $file.DirectoryName -ChildPath ($file.BaseName + "-replay.vrs")
$jsonContent = @{
Expand All @@ -290,11 +304,17 @@ jobs:
Set-Content -Path $jsonPath -Value $jsonContent
echo "$jsonContent"
$godot = "Godot_v4.3-beta1_win64.exe"
$godot = "Godot_v${{ env.GODOT_VERSION }}_win64.exe"
$timeout = 300
$waitTime = 0
$process = Start-Process -FilePath "$godot" -ArgumentList "--path demo --rendering-method mobile --verbose -- --quit-with-openxr" -NoNewWindow -PassThru
$projectPath = (Get-Item $file.DirectoryName).Parent
Write-Output ""
Write-Output " ** Running VRS $($file.Name) on project $($projectPath.Name)"
Write-Output ""
$process = Start-Process -FilePath "$godot" -ArgumentList "--path $($projectPath.FullName) --rendering-method mobile --verbose -- --quit-with-openxr" -NoNewWindow -PassThru
while ($process.HasExited -eq $false -and $waitTime -lt $timeout) {
Start-Sleep -Seconds 1
Expand Down Expand Up @@ -329,7 +349,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ReplayVRS
path: tests/vrs/**/*
path: '**/*/tests/*.vrs'

compare_vrs_replay:
name: "Compare VRS replay"
Expand Down Expand Up @@ -364,7 +384,7 @@ jobs:
patch -p0 < ../../thirdparty/meta_xr_simulator/vrs_pixmatch.patch
mkdir diffs
for replay in *-replay.vrs; do
for replay in $(find . -name \*-replay.vrs); do
expected=$(echo $replay | sed -e 's/-replay.vrs$/.vrs/')
python vrs_pixmatch.py "$replay" "$expected" --threshold 0.4 --best_match_pixels_diff_threshold 40000 --diffs_output_path diffs
done
Expand Down
File renamed without changes.
Binary file not shown.
Binary file added samples/fb-passthrough-sample/tests/test1.vrs
Binary file not shown.

0 comments on commit a573e82

Please sign in to comment.