Read the prebuilt display helper path from the harness manifest
This commit is contained in:
parent
7fb1f50966
commit
fbe209cb33
3 changed files with 39 additions and 13 deletions
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
|
|
@ -466,11 +466,18 @@ jobs:
|
|||
set -euo pipefail
|
||||
SOURCE_PACKAGES_DIR="$PWD/.ci-source-packages"
|
||||
HELPER_PATH="/tmp/create-virtual-display"
|
||||
MANIFEST_PATH="/tmp/cmux-ui-test-display-harness.json"
|
||||
|
||||
rm -f "$MANIFEST_PATH"
|
||||
trap 'rm -f "$MANIFEST_PATH"' EXIT
|
||||
|
||||
clang -framework Foundation -framework CoreGraphics \
|
||||
-o "$HELPER_PATH" scripts/create-virtual-display.m
|
||||
|
||||
CMUX_UI_TEST_DISPLAY_HELPER_BINARY_PATH="$HELPER_PATH" \
|
||||
cat >"$MANIFEST_PATH" <<EOF
|
||||
{"helperBinaryPath":"$HELPER_PATH"}
|
||||
EOF
|
||||
|
||||
xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug \
|
||||
-clonedSourcePackagesDirPath "$SOURCE_PACKAGES_DIR" \
|
||||
-disableAutomaticPackageResolution \
|
||||
|
|
|
|||
10
.github/workflows/test-e2e.yml
vendored
10
.github/workflows/test-e2e.yml
vendored
|
|
@ -209,13 +209,17 @@ jobs:
|
|||
|
||||
if [ "$TEST_FILTER" = "DisplayResolutionRegressionUITests" ]; then
|
||||
HELPER_PATH="/tmp/create-virtual-display"
|
||||
MANIFEST_PATH="/tmp/cmux-ui-test-display-harness.json"
|
||||
|
||||
rm -f "$MANIFEST_PATH"
|
||||
trap 'rm -f "$MANIFEST_PATH"' EXIT
|
||||
|
||||
clang -framework Foundation -framework CoreGraphics \
|
||||
-o "$HELPER_PATH" scripts/create-virtual-display.m
|
||||
|
||||
DISPLAY_ENV_PREFIX=(
|
||||
CMUX_UI_TEST_DISPLAY_HELPER_BINARY_PATH="$HELPER_PATH"
|
||||
)
|
||||
cat >"$MANIFEST_PATH" <<EOF
|
||||
{"helperBinaryPath":"$HELPER_PATH"}
|
||||
EOF
|
||||
fi
|
||||
|
||||
# Start recording right before the test (after build/resolve).
|
||||
|
|
|
|||
|
|
@ -127,10 +127,23 @@ final class DisplayResolutionRegressionUITests: XCTestCase {
|
|||
return
|
||||
}
|
||||
if let externalHarness = loadExternalHarnessFromEnvironment(env) ?? loadExternalHarnessFromManifest(env) {
|
||||
displayReadyPath = externalHarness.readyPath
|
||||
displayIDPath = externalHarness.displayIDPath
|
||||
displayStartPath = externalHarness.startPath
|
||||
displayDonePath = externalHarness.donePath
|
||||
if let helperBinaryPath = externalHarness.helperBinaryPath, !helperBinaryPath.isEmpty {
|
||||
self.helperBinaryPath = helperBinaryPath
|
||||
try launchDisplayHelper()
|
||||
return
|
||||
}
|
||||
guard let readyPath = externalHarness.readyPath, !readyPath.isEmpty,
|
||||
let displayIDPath = externalHarness.displayIDPath, !displayIDPath.isEmpty,
|
||||
let startPath = externalHarness.startPath, !startPath.isEmpty,
|
||||
let donePath = externalHarness.donePath, !donePath.isEmpty else {
|
||||
throw NSError(domain: "DisplayResolutionRegressionUITests", code: 3, userInfo: [
|
||||
NSLocalizedDescriptionKey: "Incomplete external display harness configuration"
|
||||
])
|
||||
}
|
||||
displayReadyPath = readyPath
|
||||
self.displayIDPath = displayIDPath
|
||||
displayStartPath = startPath
|
||||
displayDonePath = donePath
|
||||
if let logPath = externalHarness.logPath, !logPath.isEmpty {
|
||||
helperLogPath = logPath
|
||||
}
|
||||
|
|
@ -162,7 +175,8 @@ final class DisplayResolutionRegressionUITests: XCTestCase {
|
|||
displayIDPath: displayIDPath,
|
||||
startPath: startPath,
|
||||
donePath: donePath,
|
||||
logPath: env["CMUX_UI_TEST_DISPLAY_LOG_PATH"]
|
||||
logPath: env["CMUX_UI_TEST_DISPLAY_LOG_PATH"],
|
||||
helperBinaryPath: nil
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -394,10 +408,11 @@ final class DisplayResolutionRegressionUITests: XCTestCase {
|
|||
}
|
||||
|
||||
private struct ExternalDisplayHarness: Decodable {
|
||||
let readyPath: String
|
||||
let displayIDPath: String
|
||||
let startPath: String
|
||||
let donePath: String
|
||||
let readyPath: String?
|
||||
let displayIDPath: String?
|
||||
let startPath: String?
|
||||
let donePath: String?
|
||||
let logPath: String?
|
||||
let helperBinaryPath: String?
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue