Skip to content

Commit e74e1be

Browse files
committed
ci: switch to passport logger
1 parent 910f6c5 commit e74e1be

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

sample/Tests/test/test_windows_helpers.py

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def get_auth_url_from_unity_logs():
8080
content = f.read()
8181
# Look for either our custom message or the existing LaunchAuthURL message
8282
# Get the LAST occurrence (most recent) and make sure it's a login URL, not logout
83-
matches = re.findall(r'(?:PASSPORT_AUTH_URL: |LaunchAuthURL : )(https?://[^\s]+)', content)
83+
# Now includes [Immutable] tag from PassportLogger
84+
matches = re.findall(r'(?:\[Immutable\] PASSPORT_AUTH_URL: |PASSPORT_AUTH_URL: |LaunchAuthURL : )(https?://[^\s]+)', content)
8485
if matches:
8586
# Get the last URL and make sure it's not a logout URL
8687
for url in reversed(matches):
@@ -124,8 +125,9 @@ def get_logout_url_from_unity_logs():
124125
try:
125126
with open(log_path, 'r', encoding='utf-8', errors='ignore') as f:
126127
content = f.read()
127-
# Look for logout URLs in Unity logs
128-
matches = re.findall(r'(?:PASSPORT_LOGOUT_URL: |LaunchAuthURL : )(https?://[^\s]+)', content)
128+
# Look for logout URLs in Unity logs (uses same PASSPORT_AUTH_URL pattern)
129+
# Now includes [Immutable] tag from PassportLogger
130+
matches = re.findall(r'(?:\[Immutable\] PASSPORT_AUTH_URL: |PASSPORT_AUTH_URL: |LaunchAuthURL : )(https?://[^\s]+)', content)
129131
if matches:
130132
# Get the last URL and make sure it's a logout URL
131133
for url in reversed(matches):
@@ -573,7 +575,28 @@ def open_sample_app(clear_data=False):
573575
clear_unity_data()
574576

575577
print(f"Opening {product_name}...")
576-
subprocess.Popen([f"{product_name}.exe"], shell=True)
578+
579+
# Look for the executable in build folder first, then current directory
580+
exe_paths = [
581+
f"../build/{product_name}.exe", # Relative to Tests folder
582+
f"{product_name}.exe" # Current directory (fallback)
583+
]
584+
585+
exe_launched = False
586+
for exe_path in exe_paths:
587+
if os.path.exists(exe_path):
588+
print(f"Found executable at: {exe_path}")
589+
subprocess.Popen([exe_path], shell=True)
590+
exe_launched = True
591+
break
592+
593+
if not exe_launched:
594+
print(f"ERROR: Could not find {product_name}.exe in any of these locations:")
595+
for path in exe_paths:
596+
abs_path = os.path.abspath(path)
597+
print(f" - {abs_path} (exists: {os.path.exists(abs_path)})")
598+
raise FileNotFoundError(f"Unity executable not found")
599+
577600
time.sleep(10)
578601
print(f"{product_name} opened successfully.")
579602

src/Packages/Passport/Runtime/ThirdParty/ImmutableBrowserCore/Immutable.Browser.Core.asmdef

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "Immutable.Browser.Core",
33
"rootNamespace": "Immutable.Browser.Core",
44
"references": [
5-
"GUID:f51ebe6a0ceec4240a699833d6309b23"
5+
"UniTask",
6+
"Immutable.Passport.Core.Logging"
67
],
78
"includePlatforms": [],
89
"excludePlatforms": [],

src/Packages/Passport/Runtime/ThirdParty/ImmutableBrowserCore/WindowsWebBrowserClientAdapter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO;
44
using UnityEngine;
55
using Immutable.Browser.Core;
6+
using Immutable.Passport.Core.Logging;
67
using Cysharp.Threading.Tasks;
78

89
namespace Immutable.Browser.Core
@@ -51,7 +52,7 @@ public void ExecuteJs(string js)
5152
public void LaunchAuthURL(string url, string? redirectUri)
5253
{
5354
// Log the auth URL for test automation to capture
54-
Debug.Log($"PASSPORT_AUTH_URL: {url}");
55+
PassportLogger.Info($"PASSPORT_AUTH_URL: {url}");
5556
Application.OpenURL(url);
5657
}
5758

0 commit comments

Comments
 (0)