Skip to content

Commit

Permalink
Merge branch 'wordpress-mobile-develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignacio Bonafonte committed Apr 16, 2020
2 parents 188f5ef + 8d3997f commit 8d72be3
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 111 deletions.
38 changes: 17 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@ commands:
echo $PATH
fi
save-xcresult:
steps:
- run:
name: Zip xcresult
command: |
mkdir testresults
zip -r testresults/xcresult.zip test-without-building.xcresult
when: on_fail # Zips the .xcresult file when tests fail, so it can be saved
- store_artifacts:
name: Save xcresult
path: testresults
destination: logs

jobs:
Build Tests:
executor:
Expand All @@ -51,23 +38,28 @@ jobs:
paths:
- DerivedData/Build/Products
- Pods/WordPressMocks
- vendor/bundle
Unit Tests:
executor:
name: ios/default
xcode-version: "11.2.1"
steps:
- fix-path
- git/shallow-checkout
- ios/boot-simulator:
xcode-version: "11.2.1"
device: iPhone 11
- attach_workspace:
at: ./
- run:
name: Prepare Bundle
command: bundle --path vendor/bundle
- ios/wait-for-simulator
- ios/xcodebuild:
command: test-without-building
arguments: -xctestrun DerivedData/Build/Products/WordPress_WordPressUnitTests_iphonesimulator13.2-x86_64.xctestrun -destination "platform=iOS Simulator,id=$SIMULATOR_UDID" -resultBundlePath test-without-building.xcresult
- run:
name: Run Unit Tests
working_directory: Scripts
command: bundle exec fastlane test_without_building xctestrun:DerivedData/Build/Products/WordPress_WordPressUnitTests_iphonesimulator13.2-x86_64.xctestrun destination:"platform=iOS Simulator,id=$SIMULATOR_UDID" try_count:3
- ios/save-xcodebuild-artifacts
- save-xcresult
UI Tests:
parameters:
device:
Expand All @@ -81,21 +73,25 @@ jobs:
xcode-version: "11.2.1"
steps:
- fix-path
- git/shallow-checkout
- ios/boot-simulator:
xcode-version: "11.2.1"
device: << parameters.device >>
- attach_workspace:
at: ./
- run:
name: Prepare Bundle
command: bundle --path vendor/bundle
- run:
name: Run mocks
command: ./Pods/WordPressMocks/scripts/start.sh 8282
background: true
- ios/wait-for-simulator
- ios/xcodebuild:
command: test-without-building
arguments: -xctestrun DerivedData/Build/Products/WordPress_WordPressUITests_iphonesimulator13.2-x86_64.xctestrun -destination "platform=iOS Simulator,id=$SIMULATOR_UDID" -resultBundlePath test-without-building.xcresult
- run:
name: Run UI Tests
working_directory: Scripts
command: bundle exec fastlane test_without_building xctestrun:DerivedData/Build/Products/WordPress_WordPressUITests_iphonesimulator13.2-x86_64.xctestrun destination:"platform=iOS Simulator,id=$SIMULATOR_UDID" try_count:3
- ios/save-xcodebuild-artifacts
- save-xcresult
- when:
condition: << parameters.post-to-slack >>
steps:
Expand Down
9 changes: 9 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ GEM
cocoapods-try (1.1.0)
colored (1.2)
colored2 (3.1.2)
colorize (0.8.1)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
commonmarker (0.20.1)
Expand Down Expand Up @@ -144,6 +145,12 @@ GEM
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-appcenter (1.7.1)
fastlane-plugin-sentry (1.6.0)
fastlane-plugin-test_center (3.10.1)
colorize
json
plist
xcodeproj
xctest_list (>= 1.1.8)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
Expand Down Expand Up @@ -270,6 +277,7 @@ GEM
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
xcpretty (~> 0.2, >= 0.0.7)
xctest_list (1.1.8)

PLATFORMS
ruby
Expand All @@ -281,6 +289,7 @@ DEPENDENCIES
fastlane (= 2.143.0)!
fastlane-plugin-appcenter (= 1.7.1)
fastlane-plugin-sentry
fastlane-plugin-test_center
fastlane-plugin-wpmreleasetoolkit!
octokit (~> 4.0)!
rake!
Expand Down
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ target 'WordPress' do

pod 'Gridicons', '~> 1.0.1'

pod 'WordPressAuthenticator', '~> 1.13.0-beta.2'
pod 'WordPressAuthenticator', '~> 1.13.0-beta.3'
# While in PR
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :branch => 'try/switch-primary-button'
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :branch => ''
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :commit => ''
# pod 'WordPressAuthenticator', :path => '../WordPressAuthenticator-iOS'

Expand Down
8 changes: 4 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ PODS:
- WordPress-Aztec-iOS (1.17.1)
- WordPress-Editor-iOS (1.17.1):
- WordPress-Aztec-iOS (= 1.17.1)
- WordPressAuthenticator (1.13.0-beta.2):
- WordPressAuthenticator (1.13.0-beta.3):
- 1PasswordExtension (= 1.8.6)
- Alamofire (= 4.8)
- CocoaLumberjack (~> 3.5)
Expand Down Expand Up @@ -479,7 +479,7 @@ DEPENDENCIES:
- Starscream (= 3.0.6)
- SVProgressHUD (= 2.2.5)
- WordPress-Editor-iOS (~> 1.17.1)
- WordPressAuthenticator (~> 1.13.0-beta.2)
- WordPressAuthenticator (~> 1.13.0-beta.3)
- WordPressKit (~> 4.7.1-beta.1)
- WordPressMocks (~> 0.0.8)
- WordPressShared (~> 1.8.16)
Expand Down Expand Up @@ -697,7 +697,7 @@ SPEC CHECKSUMS:
UIDeviceIdentifier: 44f805037d21b94394821828f4fcaba34b38c2d0
WordPress-Aztec-iOS: 319620514af963ca519bd83b96a2c0ebdf3a0f03
WordPress-Editor-iOS: 497b55838ef0030cc6ca82eb92da84e661423521
WordPressAuthenticator: 693ff4ee341e1cf9acb6d1fb53c5372ab6efb10f
WordPressAuthenticator: 6aa4deec9a328c354ea08a1d1a60f1ca19cb8279
WordPressKit: dde0a214279fb70d7150b69ae90c7224c18fe2d0
WordPressMocks: b4064b99a073117bbc304abe82df78f2fbe60992
WordPressShared: 1bc316ed162f42af4e0fa2869437e9e28b532b01
Expand All @@ -714,6 +714,6 @@ SPEC CHECKSUMS:
ZendeskSupportSDK: a87ab1e4badace92c75eb11dc77ede1e995b2adc
ZIPFoundation: 249fa8890597086cd536bb2df5c9804d84e122b0

PODFILE CHECKSUM: d4b871b14b78129b9c99ba51d55b4442c8655acc
PODFILE CHECKSUM: 318b388b9de5b3025ac2de8fe4119edf6ce8a261

COCOAPODS: 1.8.4
3 changes: 2 additions & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
14.7
-----
* [internal] the signup flow using email has code changes that can cause regressions. See https://git.io/JvALZ for testing details.
* Classic Editor: Fixed action sheet position for additional Media sources picker on iPad
* [internal] the signup flow using email has code changes that can cause regressions. See https://git.io/JvALZ for testing details.
* [internal] Notifications tab should pop to the root of the navigation stack when tapping on the tab from within a notification detail screen. See https://git.io/Jvxka for testing details.
* [internal] the login by email flow and the self-hosted login flow have code changes that can cause regressions. See https://git.io/JfeFN for testing details.
* Updated the appearance of the login and signup buttons to make signup more prominent.

14.6
Expand Down
56 changes: 44 additions & 12 deletions Scripts/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@ def get_required_env(key)
ENV[key]
end

before_all do
# Check that the env files exist
unless is_ci || File.file?(USER_ENV_FILE_PATH)
UI.user_error!("~/.wpios-env.default not found: Please copy env/user.env-example to #{USER_ENV_FILE_PATH} and fill in the values")
end
unless File.file?(PROJECT_ENV_FILE_PATH)
UI.user_error!("project.env not found: Make sure your configuration is up to date with `rake dependencies`")
end
before_all do |lane|
# Skip these checks/steps for test lane (not needed for testing)
unless lane == :test_without_building
# Check that the env files exist
unless is_ci || File.file?(USER_ENV_FILE_PATH)
UI.user_error!("~/.wpios-env.default not found: Please copy env/user.env-example to #{USER_ENV_FILE_PATH} and fill in the values")
end
unless File.file?(PROJECT_ENV_FILE_PATH)
UI.user_error!("project.env not found: Make sure your configuration is up to date with `rake dependencies`")
end

# This allows code signing to work on CircleCI
# It is skipped if this isn't running on CI
# See https://circleci.com/docs/2.0/ios-codesigning/
setup_circle_ci
# This allows code signing to work on CircleCI
# It is skipped if this isn't running on CI
# See https://circleci.com/docs/2.0/ios-codesigning/
setup_circle_ci
end
end

platform :ios do
Expand Down Expand Up @@ -483,6 +486,35 @@ import "./ScreenshotFastfile"
"org.wordpress.WordPressThisWeekWidget"])
end

########################################################################
# Test Lanes
########################################################################
#####################################################################################
# test_without_building
# -----------------------------------------------------------------------------------
# This lane runs tests without building the app.
# It requires a prebuilt xctestrun file and simulator destination where the tests will be run.
# -----------------------------------------------------------------------------------
# Usage:
# bundle exec fastlane test_without_building [xctestrun:<Path to xctestrun file>] [destination:<Simulator>] [try_count:<Number of times to try tests>]
#
# Example:
# bundle exec fastlane test_without_building xctestrun:WordPress_WordPressUITests_iphonesimulator13.2-x86_64.xctestrun destination:"platform=iOS Simulator,id=$SIMULATOR_UDID" try_count:3
#####################################################################################
desc "Run tests without building"
lane :test_without_building do | options |
multi_scan(
workspace: "../WordPress.xcworkspace",
scheme: "WordPress",
test_without_building: true,
xctestrun: "../#{options[:xctestrun]}",
destination: options[:destination],
try_count: options[:try_count],
output_directory: "../build/results",
result_bundle: true
)
end

########################################################################
# Helper Lanes
########################################################################
Expand Down
1 change: 1 addition & 0 deletions Scripts/fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ end
gem 'fastlane-plugin-wpmreleasetoolkit', git: 'https://github.com/wordpress-mobile/release-toolkit', tag: '0.9.1'
gem 'fastlane-plugin-sentry'
gem 'fastlane-plugin-appcenter', '1.7.1'
gem 'fastlane-plugin-test_center'
5 changes: 0 additions & 5 deletions WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
enum FeatureFlag: Int, CaseIterable {
case jetpackDisconnect
case debugMenu
case postReblogging
case unifiedAuth
case quickActions
case meMove
Expand All @@ -23,8 +22,6 @@ enum FeatureFlag: Int, CaseIterable {
case .debugMenu:
return BuildConfiguration.current ~= [.localDeveloper,
.a8cBranchTest]
case .postReblogging:
return true
case .unifiedAuth:
return BuildConfiguration.current == .localDeveloper
case .quickActions:
Expand Down Expand Up @@ -57,8 +54,6 @@ extension FeatureFlag: OverrideableFlag {
return "Jetpack disconnect"
case .debugMenu:
return "Debug menu"
case .postReblogging:
return "Post Reblogging"
case .unifiedAuth:
return "Unified Auth"
case .quickActions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ class NewBlogDetailHeaderView: UIView {
stackView.setCustomSpacing(Constants.spacingBelowIcon, after: siteIconView)
stackView.setCustomSpacing(Constants.spacingBelowTitle, after: titleLabel)

/// Constraints for larger widths with extra padding (iPhone portrait)
let extraPaddingSideConstraints = [
buttonsStackView.trailingAnchor.constraint(greaterThanOrEqualTo: stackView.trailingAnchor, constant: -Constants.buttonsSidePadding),
buttonsStackView.leadingAnchor.constraint(lessThanOrEqualTo: stackView.leadingAnchor, constant: Constants.buttonsSidePadding)
]

/// Constraints for constrained widths (iPad portrait)
let minimumPaddingSideConstraints = [
buttonsStackView.leadingAnchor.constraint(greaterThanOrEqualTo: stackView.leadingAnchor, constant: 0),
Expand All @@ -119,21 +113,21 @@ class NewBlogDetailHeaderView: UIView {
let bottomConstraint = buttonsStackView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -Constants.buttonsBottomPadding)
bottomConstraint.priority = UILayoutPriority(999) // Allow to break so encapsulated height (on initial table view load) doesn't spew warnings

/// If we are able to attach to the safe area's leading edge, we should, otherwise it can break
let leadingSafeAreaConstraint = stackView.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor)
leadingSafeAreaConstraint.priority = .defaultHigh
let widthConstraint = buttonsStackView.widthAnchor.constraint(equalToConstant: 320)
widthConstraint.priority = .defaultHigh

let edgeConstraints = [
leadingSafeAreaConstraint,
stackView.trailingAnchor.constraint(equalTo: layoutMarginsGuide.trailingAnchor),
stackView.trailingAnchor.constraint(lessThanOrEqualTo: layoutMarginsGuide.trailingAnchor),
stackView.leadingAnchor.constraint(greaterThanOrEqualTo: leadingAnchor, constant: Constants.minimumSideSpacing),
stackView.topAnchor.constraint(equalTo: topAnchor, constant: Constants.interSectionSpacing),
stackView.centerXAnchor.constraint(equalTo: layoutMarginsGuide.centerXAnchor),
buttonsStackView.topAnchor.constraint(equalTo: stackView.bottomAnchor, constant: Constants.interSectionSpacing),
buttonsStackView.centerXAnchor.constraint(equalTo: stackView.centerXAnchor),
bottomConstraint
bottomConstraint,
widthConstraint
]

NSLayoutConstraint.activate(extraPaddingSideConstraints + minimumPaddingSideConstraints + edgeConstraints)
NSLayoutConstraint.activate(minimumPaddingSideConstraints + edgeConstraints)
}

override init(frame: CGRect) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,6 @@ open class ReaderDetailViewController: UIViewController, UIViewControllerRestora
WPStyleGuide.applyReaderCardTagButtonStyle(tagButton)
WPStyleGuide.applyReaderCardActionButtonStyle(commentButton)
WPStyleGuide.applyReaderCardActionButtonStyle(likeButton)
if !FeatureFlag.postReblogging.enabled {
// this becomes redundant, as saveForLaterButton does not have a label anymore
// and applyReaderActionButtonStyle() is called by applyReaderSaveForLaterButtonStyle
// which in turn is called by configureSaveForLaterButton. Same considerations for
// reblog button
WPStyleGuide.applyReaderCardActionButtonStyle(saveForLaterButton)
}

view.backgroundColor = .listBackground

Expand Down Expand Up @@ -952,9 +945,7 @@ open class ReaderDetailViewController: UIViewController, UIViewControllerRestora
likeButton.isEnabled = ReaderHelpers.isLoggedIn()
// as by design spec, only display like counts
let likeCount = post?.likeCount()?.intValue ?? 0
let shortTitle = likeCount > 0 ? "\(likeCount)" : ""

let title = FeatureFlag.postReblogging.enabled ? shortTitle : post?.likeCountForDisplay()
let title = likeCount > 0 ? "\(likeCount)" : ""

let selected = post?.isLiked ?? false
let likeImage = UIImage(named: "icon-reader-like")
Expand All @@ -969,9 +960,6 @@ open class ReaderDetailViewController: UIViewController, UIViewControllerRestora

/// Uses the configuration in WPStyleGuide for the reblog button
fileprivate func configureReblogButton() {
guard FeatureFlag.postReblogging.enabled else {
return
}
reblogButton.isHidden = false
WPStyleGuide.applyReaderReblogActionButtonStyle(reblogButton, showTitle: false)
}
Expand Down Expand Up @@ -1052,12 +1040,7 @@ open class ReaderDetailViewController: UIViewController, UIViewControllerRestora

fileprivate func configureSaveForLaterButton() {
WPStyleGuide.applyReaderSaveForLaterButtonStyle(saveForLaterButton)
if FeatureFlag.postReblogging.enabled {
WPStyleGuide.applyReaderSaveForLaterButtonTitles(saveForLaterButton, showTitle: false)
} else {
WPStyleGuide.applyReaderSaveForLaterButtonTitles(saveForLaterButton)
}

WPStyleGuide.applyReaderSaveForLaterButtonTitles(saveForLaterButton, showTitle: false)

saveForLaterButton.isHidden = false
saveForLaterButton.isSelected = post?.isSavedForLater ?? false
Expand Down Expand Up @@ -1563,9 +1546,7 @@ extension ReaderDetailViewController: Accessible {
prepareHeaderForVoiceOver()
prepareContentForVoiceOver()
prepareActionButtonsForVoiceOver()
if FeatureFlag.postReblogging.enabled {
prepareReblogForVoiceOver()
}
prepareReblogForVoiceOver()

NotificationCenter.default.addObserver(self,
selector: #selector(setBarsAsVisibleIfVoiceOverIsEnabled),
Expand Down
Loading

0 comments on commit 8d72be3

Please sign in to comment.