Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0503ae7
Disable parallel test execution
tiagomar Jul 8, 2023
80bc8c6
Avoid parallel tests in CI
tiagomar Jul 8, 2023
2da673b
Empty commit to trigger the CI
tiagomar Jul 10, 2023
b886337
Disable AutoFill Passwords from Pre-Action script instead of navigati…
tiagomar Jul 11, 2023
96714ba
Enable parallel test execution
tiagomar Jul 11, 2023
bdcb9e2
Disable AutoFill Password form run-ui-tests script
tiagomar Jul 12, 2023
668037c
Disable AutoFill Password form run-ui-tests script v2
tiagomar Jul 12, 2023
2a563f7
Disable AutoFill Password form run-ui-tests script v3
tiagomar Jul 12, 2023
6b15875
Disable AutoFill Password form run-ui-tests script v4
tiagomar Jul 12, 2023
98fac92
Disable AutoFill Password form run-ui-tests script v5
tiagomar Jul 12, 2023
66f84df
Simplify the pipeline for testing
tiagomar Jul 12, 2023
462bc78
Disable some tests
tiagomar Jul 12, 2023
12e51cc
Disable AutoFill Password from run-ui-tests script v6 - PlistBuddy
tiagomar Jul 12, 2023
174beab
Disable AutoFill Password from run-ui-tests script v7 - PlistBuddy
tiagomar Jul 13, 2023
82410d2
Disable AutoFill Password from run-ui-tests script v8 - PlistBuddy
tiagomar Jul 13, 2023
1595b4b
Add unit tests step back to the pipeline
tiagomar Jul 13, 2023
1108c9d
Single concurrent simulator
tiagomar Jul 13, 2023
623b1ad
Disable AutoFill Password from pre-actions script and PlistBuddy v1
tiagomar Jul 13, 2023
8eb707d
Empty commit to trigger the CI
tiagomar Jul 13, 2023
007e621
Disable AutoFill Password form run-ui-tests script v6
tiagomar Jul 13, 2023
622db16
Disable AutoFill Password form run-ui-tests script v7
tiagomar Jul 13, 2023
35604cc
Disable AutoFill Password form run-ui-tests script v8
tiagomar Jul 13, 2023
49c50fa
Disable AutoFill Password form run-ui-tests script - copy plist file …
tiagomar Jul 14, 2023
8856991
Disable AutoFill Password form run-ui-tests script - copy plist file …
tiagomar Jul 14, 2023
41e1b48
Disable AutoFill Password form run-ui-tests script - copy plist file …
tiagomar Jul 14, 2023
7e7fd65
Disable AutoFill Password form run-ui-tests script - copy plist file …
tiagomar Jul 14, 2023
b3160ed
Disable AutoFill Password form run-ui-tests script - copy plist file …
tiagomar Jul 14, 2023
efdb182
Disable AutoFill Password form run-ui-tests script - copy plist file …
tiagomar Jul 14, 2023
18d5c2f
Disable AutoFill Password form run-ui-tests script - copy all plist f…
tiagomar Jul 17, 2023
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
43 changes: 42 additions & 1 deletion .buildkite/commands/run-ui-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,52 @@ echo "--- :swift: Setting up Swift Packages"
install_swiftpm_dependencies

echo "--- 🔬 Testing"
xcrun simctl list >> /dev/null
echo "LIST DEVICES"
xcrun simctl list
# xcrun simctl --set testing list devices

echo "COPY USER SETTINGS PLIST"
echo "===> iPad"
echo "------> mkdir"
mkdir -p /Users/builder/Library/Developer/CoreSimulator/Devices/FC4B5BA1-C4A0-4C60-94FE-8C40B29C17AD/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles
mkdir -p /Users/builder/Library/Developer/CoreSimulator/Devices/FC4B5BA1-C4A0-4C60-94FE-8C40B29C17AD/data/Library/UserConfigurationProfiles
mkdir -p /Users/builder/Library/Developer/CoreSimulator/Devices/FC4B5BA1-C4A0-4C60-94FE-8C40B29C17AD/data/Library/UserConfigurationProfiles/PublicInfo
echo "------> cp"
cp WordPress/UITests/UserSettings.plist /Users/builder/Library/Developer/CoreSimulator/Devices/FC4B5BA1-C4A0-4C60-94FE-8C40B29C17AD/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles/
cp WordPress/UITests/EffectiveUserSettings.plist /Users/builder/Library/Developer/CoreSimulator/Devices/FC4B5BA1-C4A0-4C60-94FE-8C40B29C17AD/data/Library/UserConfigurationProfiles/
cp WordPress/UITests/PublicEffectiveUserSettings.plist /Users/builder/Library/Developer/CoreSimulator/Devices/FC4B5BA1-C4A0-4C60-94FE-8C40B29C17AD/data/Library/UserConfigurationProfiles/PublicInfo/


echo "===> iPhone"
echo "------> mkdir"
mkdir -p /Users/builder/Library/Developer/CoreSimulator/Devices/435326FA-9F81-4C3E-96B8-92446A5B0075/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles
mkdir -p /Users/builder/Library/Developer/CoreSimulator/Devices/435326FA-9F81-4C3E-96B8-92446A5B0075/data/Library/UserConfigurationProfiles
mkdir -p /Users/builder/Library/Developer/CoreSimulator/Devices/435326FA-9F81-4C3E-96B8-92446A5B0075/data/Library/UserConfigurationProfiles/PublicInfo
echo "------> cp"
cp WordPress/UITests/UserSettings.plist /Users/builder/Library/Developer/CoreSimulator/Devices/435326FA-9F81-4C3E-96B8-92446A5B0075/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles/
cp WordPress/UITests/EffectiveUserSettings.plist /Users/builder/Library/Developer/CoreSimulator/Devices/435326FA-9F81-4C3E-96B8-92446A5B0075/data/Library/UserConfigurationProfiles/
cp WordPress/UITests/PublicEffectiveUserSettings.plist /Users/builder/Library/Developer/CoreSimulator/Devices/435326FA-9F81-4C3E-96B8-92446A5B0075/data/Library/UserConfigurationProfiles/PublicInfo/

echo "FIND - *.plist"
find ~/Library/Developer/CoreSimulator/Devices -path "*s.plist" -print0 | while IFS= read -r -d $'\0' plist_file; do
echo $plist_file
done

echo "SHUTDOWN ALL SIMULATORS"
xcrun simctl shutdown all


rake mocks &
set +e
bundle exec fastlane test_without_building name:Jetpack device:"$DEVICE"
TESTS_EXIT_STATUS=$?
echo "LIST DEVICES AFTER"
xcrun simctl list
xcrun simctl --set testing list devices
echo "FIND - *.plist"
find ~/Library/Developer/XCTestDevices -path "*.plist" -print0 | while IFS= read -r -d $'\0' plist_file; do
echo $plist_file
done
set -e

if [[ "$TESTS_EXIT_STATUS" -ne 0 ]]; then
Expand Down
50 changes: 0 additions & 50 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,6 @@ common_params:
# This is the default pipeline – it will build and test the app
steps:

#################
# Create Prototype Builds for WP and JP
#################
- group: "🛠 Prototype Builds"
steps:
- label: "🛠 WordPress Prototype Build"
command: ".buildkite/commands/prototype-build-wordpress.sh"
env: *common_env
plugins: *common_plugins
if: "build.pull_request.id != null || build.pull_request.draft"
notify:
- github_commit_status:
context: "WordPress Prototype Build"

- label: "🛠 Jetpack Prototype Build"
command: ".buildkite/commands/prototype-build-jetpack.sh"
env: *common_env
plugins: *common_plugins
if: "build.pull_request.id != null || build.pull_request.draft"
notify:
- github_commit_status:
context: "Jetpack Prototype Build"

#################
# Create Builds for Testing
#################
Expand Down Expand Up @@ -102,30 +79,3 @@ steps:
notify:
- github_commit_status:
context: "UI Tests (iPad)"

#################
# Linters
#################
- group: "Linters"
steps:
- label: "🧹 Lint Translations"
command: "gplint /workdir/WordPress/Resources/AppStoreStrings.po"
plugins:
- docker#v3.8.0:
image: "public.ecr.aws/automattic/glotpress-validator:1.0.0"
agents:
queue: "default"
notify:
- github_commit_status:
context: "Lint Translations"
# This step uses Danger to run RuboCop, but it's "agnostic" about it.
# That is, it outwardly only mentions RuboCop, not Danger
- label: ":rubocop: Lint Ruby Tooling"
command: .buildkite/commands/rubocop-via-danger.sh
plugins: *common_plugins
agents:
queue: "android"
- label: ":sleuth_or_spy: Lint Localized Strings Format"
command: .buildkite/commands/lint-localized-strings-format.sh
plugins: *common_plugins
env: *common_env
Binary file added WordPress/UITests/EffectiveUserSettings.plist
Binary file not shown.
7 changes: 6 additions & 1 deletion WordPress/UITests/JetpackUITests.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@
},
"testTargets" : [
{
"parallelizable" : true,
"skippedTests" : [
"DashboardTests",
"EditorAztecTests",
"EditorGutenbergTests",
"LoginTests",
"LoginTests\/testEmailMagicLinkLogin()",
"ReaderTests",
"SignupTests",
"SignupTests\/testEmailSignup()",
"StatsTests",
"SupportScreenTests",
"SupportScreenTests\/testSupportForumsCanBeLoadedDuringLogin()"
],
"target" : {
Expand Down
Binary file not shown.
Binary file added WordPress/UITests/UserSettings.plist
Binary file not shown.
21 changes: 0 additions & 21 deletions WordPress/UITests/Utils/XCTest+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ extension XCTestCase {
removeBeforeLaunching: Bool = false,
crashOnCoreDataConcurrencyIssues: Bool = true
) {
// To avoid handling 'Save Password' prompts after login.
disableAutoFillPasswords()

// To ensure that the test starts with a new simulator launch each time
app.terminate()
super.setUp()
Expand All @@ -35,24 +32,6 @@ extension XCTestCase {
systemAlertHandler(alertTitle: "“WordPress” Would Like to Access Your Photos", alertButton: alertButtonTitle)
}

public func disableAutoFillPasswords() {
let settings = XCUIApplication(bundleIdentifier: "com.apple.Preferences")
settings.activate()
settings.staticTexts["Passwords"].tap()

let enterPasscodeScreen = XCUIApplication(bundleIdentifier: "com.apple.springboard")
enterPasscodeScreen.secureTextFields["Passcode field"].typeText(" ")
enterPasscodeScreen.buttons["done"].tap()

settings.staticTexts["Password Options"].tap()

let autoFillPasswordsSwitch = settings.switches["AutoFill Passwords"]
if autoFillPasswordsSwitch.value as? String == "1" {
autoFillPasswordsSwitch.tap()
}
settings.terminate()
}

public func takeScreenshotOfFailedTest() {
guard let failuresCount = testRun?.failureCount, failuresCount > 0 else { return }

Expand Down
8 changes: 7 additions & 1 deletion WordPress/WordPress.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8868,7 +8868,10 @@
E850CD4B77CF21E683104B5A /* Pods-WordPressStatsWidgets.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressStatsWidgets.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressStatsWidgets/Pods-WordPressStatsWidgets.debug.xcconfig"; sourceTree = "<group>"; };
EA14534229AD874C001F3143 /* JetpackUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JetpackUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
EA14534629AEF479001F3143 /* JetpackUITests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = JetpackUITests.xctestplan; sourceTree = "<group>"; };
EA2002C82A60E8C500AED5AF /* UserSettings.plist */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = UserSettings.plist; sourceTree = "<group>"; };
EA78189327596B2F00554DFA /* ContactUsScreen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactUsScreen.swift; sourceTree = "<group>"; };
EA85B7A22A65B4290096E097 /* EffectiveUserSettings.plist */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = EffectiveUserSettings.plist; sourceTree = "<group>"; };
EA85B7A32A65B4430096E097 /* PublicEffectiveUserSettings.plist */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = PublicEffectiveUserSettings.plist; sourceTree = "<group>"; };
EAB10E3F27487F5D000DA4C1 /* ReaderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderTests.swift; sourceTree = "<group>"; };
EAD08D0D29D45E23001A72F9 /* CommentsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentsScreen.swift; sourceTree = "<group>"; };
EAD2BF4127594DAB00A847BB /* StatsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatsTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -18215,6 +18218,9 @@
EA14534629AEF479001F3143 /* JetpackUITests.xctestplan */,
80D65C1129CC0813008E69D5 /* JetpackUITests-Info.plist */,
FF2716931CAAC87B0006E2D4 /* WordPressUITests-Info.plist */,
EA2002C82A60E8C500AED5AF /* UserSettings.plist */,
EA85B7A22A65B4290096E097 /* EffectiveUserSettings.plist */,
EA85B7A32A65B4430096E097 /* PublicEffectiveUserSettings.plist */,
);
path = UITests;
sourceTree = "<group>";
Expand Down Expand Up @@ -20667,7 +20673,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Close all simulators so on next launch they use the settings below\nxcrun simctl shutdown all\n\n# Disable the hardware keyboard in the simulator\ndefaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false\n";
shellScript = "# Close all simulators so on next launch they use the settings below\nxcrun simctl shutdown all\necho \"====================== SETUP SIMULATOR ==============================\"\n\n# Disable the hardware keyboard in the simulator\ndefaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false\n";
};
F9C5CF0222CD5DB0007CEF56 /* Copy Alternate Internal Icons (if needed) */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Disable AutoFill Passwords"
scriptText = "echo &quot;==============&gt; PRE-ACTIONS&quot;&#10;# Shutdown all simulators as the changes to plist files only take effect after reboot.&#10;xcrun simctl shutdown all&#10;&#10;# Disable AutoFill Passwords&#10;IPAD_PLIST=&quot;/Users/builder/Library/Developer/CoreSimulator/Devices/FC4B5BA1-C4A0-4C60-94FE-8C40B29C17AD/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles/UserSettings.plist&quot;&#10;IPHONE_PLIST=&quot;/Users/builder/Library/Developer/CoreSimulator/Devices/435326FA-9F81-4C3E-96B8-92446A5B0075/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles/UserSettings.plist&quot;&#10;/usr/libexec/PlistBuddy -c &quot;Add :restrictedBool:allowPasswordAutoFill:value bool NO&quot; $IPAD_PLIST&#10;/usr/libexec/PlistBuddy -c &quot;Add :restrictedBool:allowPasswordAutoFill:value bool false&quot; $IPHONE_PLIST&#10;&#10;echo &quot;&lt;============== PRE-ACTIONS&quot;&#10;">
</ActionContent>
</ExecutionAction>
</PreActions>
<TestPlans>
<TestPlanReference
reference = "container:UITests/JetpackUITests.xctestplan"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "# Type a script or drag a script file from your workspace to insert its path.&#10;echo &quot;+++++++++++++++++++++++++ PRE ++++++++++++++++++++++++++&quot;&#10;">
</ActionContent>
</ExecutionAction>
</PreActions>
<PostActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "# Type a script or drag a script file from your workspace to insert its path.&#10;echo &quot;+++++++++++++++++++++++++ POS ++++++++++++++++++++++++++&quot;&#10;">
</ActionContent>
</ExecutionAction>
</PostActions>
<TestPlans>
<TestPlanReference
reference = "container:UITests/JetpackUITests.xctestplan"
Expand Down
4 changes: 2 additions & 2 deletions fastlane/lanes/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SENTRY_PROJECT_SLUG_JETPACK = 'jetpack-ios'
APPCENTER_OWNER_NAME = 'automattic'
APPCENTER_OWNER_TYPE = 'organization'
CONCURRENT_SIMULATORS = 2
CONCURRENT_SIMULATORS = 1

# Shared options to use when invoking `gym` / `build_app`.
#
Expand Down Expand Up @@ -116,7 +116,7 @@
result_bundle: true,
output_types: '',
fail_build: false,
parallel_testing: parallel_testing_value,
parallel_testing: false,
concurrent_workers: CONCURRENT_SIMULATORS,
max_concurrent_simulators: CONCURRENT_SIMULATORS
)
Expand Down