Post

Replies

Boosts

Views

Activity

Reply to Injecting variables from shell to UI test runtime
Same issue for me! I want to get the git commit and git branch from the Xcode environment (my Macbook) using a Pre-action script for "Test" and then pipe that through to the UI tests so that within the Swift XCUITest code I can call ProcessInfo.processInfo.environment["GIT_BRANCH"]. I know that the git commit and branch env variables are populated correctly inside the script. Then I tried using export and also launchctl setenv in an attempt to export the values to Xcode's environment so that the chaining into the XCUITest code would work, but it does not. Variables I set in the shell prior to launching Xcode do get piped through. But the ones set in the pre-action script are not getting through. :(
Apr ’24