Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Bump Xcode version #3509

Merged
merged 30 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f66fbb7
[CI] Bump Xcode version
testableapple Nov 5, 2024
879e863
Skip failing ui tests
testableapple Nov 5, 2024
9d5a0a3
Test
testableapple Nov 5, 2024
0fbb926
Fix
testableapple Nov 5, 2024
e688cc7
Test xcode 16.0
testableapple Nov 6, 2024
59a0d41
Test macos-15
testableapple Nov 26, 2024
05c010f
Uncomment flaky tests
testableapple Nov 27, 2024
9170f19
Revert tests
testableapple Nov 27, 2024
be4e0aa
Remove comments
testableapple Nov 27, 2024
85c661d
Force check
testableapple Nov 27, 2024
c260cff
Merge branch 'develop' into ci/xcode-16
testableapple Nov 27, 2024
b68f0dd
Bump timeout
testableapple Nov 27, 2024
921be20
Skip failing tests
testableapple Nov 27, 2024
efbc0bc
Skip some more tests
testableapple Nov 27, 2024
67a8f78
[CI] Snapshots (#3510)
Stream-SDK-Bot Nov 27, 2024
a191e58
Fix a crash in ChatChannelVC_Tests
laevandus Nov 28, 2024
e35c521
Fix a crash in ChatThreadListVC_Tests
laevandus Nov 28, 2024
814bd0b
Fix a crash in ChatThreadVC_Tests
laevandus Nov 28, 2024
04fb53e
Remove public access modifier from mock classes for avoiding a crash …
laevandus Nov 28, 2024
96e1720
Do not skip tests in ChatChannelVC_Tests and ChatMessageSearchVC_Tests
laevandus Nov 28, 2024
9350093
[CI] Snapshots (#3514)
Stream-SDK-Bot Nov 28, 2024
276bb63
Fix e2e test
testableapple Nov 28, 2024
8146d30
Remove force check
testableapple Nov 28, 2024
5b1f579
Remove yeetd
testableapple Nov 28, 2024
eb59714
Bump macos version
testableapple Nov 28, 2024
e3b7785
Cleanup added throws keywords
laevandus Nov 29, 2024
642b2f1
Add a changelog entry
testableapple Dec 3, 2024
c4d95b6
Fix name of the test library
testableapple Dec 3, 2024
b38e199
Merge branch 'develop' into ci/xcode-16
testableapple Dec 3, 2024
474ce74
Remove dot
testableapple Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 14 additions & 14 deletions .github/workflows/cron-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ jobs:
strategy:
matrix:
include:
- ios: 18.1
xcode: 16.1
os: macos-15
device: "iPhone 16 Pro"
setup_runtime: false
- ios: 17.4
xcode: 15.4
os: macos-14
Expand Down Expand Up @@ -123,6 +128,11 @@ jobs:
strategy:
matrix:
include:
- ios: 18.1
xcode: 16.1
os: macos-15
device: "iPhone 16 Pro"
setup_runtime: false
- ios: 17.4
xcode: 15.4
os: macos-14
Expand All @@ -138,16 +148,6 @@ jobs:
os: macos-14
device: "iPhone 13 Pro"
setup_runtime: true
- ios: 14.5
xcode: 14.2
os: macos-12
device: "iPhone 12 Pro"
setup_runtime: true
- ios: 13.7
xcode: 14.2
os: macos-12
device: "iPhone 11 Pro"
setup_runtime: true
fail-fast: false
runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -189,11 +189,11 @@ jobs:
fastlane/test_output/logs/*/Diagnostics/**/*.txt
fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/*

build-xcode14:
name: Build LLC + UI (Xcode 14)
runs-on: macos-12
build-old-xcode:
name: Build LLC + UI (Xcode 15)
runs-on: macos-14
env:
XCODE_VERSION: "14.0.1"
XCODE_VERSION: "15.0.1"
steps:
- name: Connect Bot
uses: webfactory/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
release:
name: Publish new release
runs-on: macos-12
runs-on: macos-15
steps:
- name: Connect Bot
uses: webfactory/[email protected]
Expand Down
26 changes: 12 additions & 14 deletions .github/workflows/smoke-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ concurrency:

env:
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI
IOS_SIMULATOR_DEVICE: "iPhone 15 Pro (17.4)"
IOS_SIMULATOR_DEVICE: "iPhone 16 Pro (18.1)"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_NUM: ${{ github.event.pull_request.number }}

Expand Down Expand Up @@ -48,9 +48,9 @@ jobs:

automated-code-review:
name: Automated Code Review
runs-on: macos-12
runs-on: macos-14
env:
XCODE_VERSION: "14.0.1"
XCODE_VERSION: "15.0.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking why not 15.4, but I guess because App Store accepts all the Xcode 15 versions

if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }}
steps:
- uses: actions/[email protected]
Expand All @@ -67,12 +67,12 @@ jobs:
if: startsWith(github.event.pull_request.head.ref, 'release/')
run: bundle exec fastlane pod_lint

build-xcode14:
name: Build LLC + UI (Xcode 14)
runs-on: macos-12
build-old-xcode:
name: Build LLC + UI (Xcode 15)
runs-on: macos-14
if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }}
env:
XCODE_VERSION: "14.0.1"
XCODE_VERSION: "15.0.1"
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/ruby-cache
Expand All @@ -87,7 +87,7 @@ jobs:

test-llc-debug:
name: Test LLC (Debug)
runs-on: macos-14
runs-on: macos-15
if: ${{ github.event.inputs.snapshots != 'true' }}
needs: build-test-app-and-frameworks
steps:
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:

test-ui-debug:
name: Test UI (Debug)
runs-on: macos-14
runs-on: macos-15
needs: build-test-app-and-frameworks
if: ${{ github.event_name != 'push' }}
steps:
Expand All @@ -152,7 +152,7 @@ jobs:
SKIP_BREW_BOOTSTRAP: true
- name: Run UI Tests (Debug)
run: bundle exec fastlane test_ui device:"${{ env.IOS_SIMULATOR_DEVICE }}" skip_build:true record:${{ github.event.inputs.snapshots }}
timeout-minutes: 60
timeout-minutes: 120
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely, I do have seen this timeout taking my run down

env:
GITHUB_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} # to open a PR
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # to use github cli
Expand All @@ -170,7 +170,7 @@ jobs:

allure_testops_launch:
name: Launch Allure TestOps
runs-on: macos-13
runs-on: macos-14
if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }}
needs: build-test-app-and-frameworks
outputs:
Expand All @@ -189,7 +189,7 @@ jobs:

test-e2e-debug:
name: Test E2E UI (Debug)
runs-on: macos-14
runs-on: macos-15
if: ${{ github.event_name != 'push' && github.event.inputs.snapshots != 'true' }}
needs:
- allure_testops_launch
Expand All @@ -216,8 +216,6 @@ jobs:
run: bundle exec fastlane test_e2e_mock device:"${{ env.IOS_SIMULATOR_DEVICE }}" batch:'${{ matrix.batch }}' test_without_building:true
timeout-minutes: 100
env:
XCODE_VERSION: "15.0.1" # the most stable pair of Xcode
IOS_SIMULATOR_DEVICE: "iPhone 15 Pro (17.0)" # and iOS
MATRIX_SIZE: ${{ strategy.job-total }}
STREAM_DEMO_APP_SECRET: ${{ secrets.STREAM_DEMO_APP_SECRET }}
- name: Allure TestOps Upload
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-copyright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
jobs:
copyright:
name: Copyright
runs-on: macos-13
runs-on: macos-14
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/ruby-cache
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### 🐞 Fixed
- Fix a rare infinite loop triggering a crash when handling database changes [#3508](https://github.com/GetStream/stream-chat-swift/pull/3508)
- Fix reconnection timeout handler not working in the token provider phase [#3513](https://github.com/GetStream/stream-chat-swift/pull/3513)
### 🔄 Changed
- Minor breaking change in the test tools. Some mock classes were made internal and now require a `@testable` annotation [#3509](https://github.com/GetStream/stream-chat-swift/pull/3509)

## StreamChatUI
### 🐞 Fixed
Expand Down
3 changes: 3 additions & 0 deletions StreamChatUITestsAppUITests/Robots/UserRobot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ extension UserRobot {
func clearComposer() -> Self {
if !composer.textView.text.isEmpty {
composer.inputField.tap()
if !composer.selectAllButton.waitForExistence(timeout: 1) {
composer.inputField.tap()
}
composer.selectAllButton.wait().safeTap()
composer.inputField.typeText(XCUIKeyboardKey.delete.rawValue)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
import Foundation
@testable import StreamChat

public class ChatChannelController_Mock: ChatChannelController {
Copy link
Member

@nuno-vieira nuno-vieira Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this won't break anything? @laevandus We do have customers using this. I wonder if, even with testable import this could break some customers 🤔 We should try to test this branch on SwiftUI to make sure it does not break the tests

class ChatChannelController_Mock: ChatChannelController {

var mockCid: ChannelId?
public override var cid: ChannelId? {
override var cid: ChannelId? {
mockCid ?? super.cid
}

var mockFirstUnreadMessageId: MessageId?
public override var firstUnreadMessageId: MessageId? {
override var firstUnreadMessageId: MessageId? {
mockFirstUnreadMessageId ?? super.firstUnreadMessageId
}

/// Creates a new mock instance of `ChatChannelController`.
public static func mock(chatClientConfig: ChatClientConfig? = nil) -> ChatChannelController_Mock {
static func mock(chatClientConfig: ChatClientConfig? = nil) -> ChatChannelController_Mock {
.init(
channelQuery: .init(cid: try! .init(cid: "mock:channel")),
channelListQuery: nil,
Expand All @@ -35,7 +35,7 @@ public class ChatChannelController_Mock: ChatChannelController {
)
}

public static func mock(
static func mock(
channelQuery: ChannelQuery,
channelListQuery: ChannelListQuery?,
client: ChatClient
Expand All @@ -47,7 +47,7 @@ public class ChatChannelController_Mock: ChatChannelController {
)
}

public static func mock(client: ChatClient) -> ChatChannelController_Mock {
static func mock(client: ChatClient) -> ChatChannelController_Mock {
.init(
channelQuery: .init(cid: try! .init(cid: "mock:channel")),
channelListQuery: nil,
Expand All @@ -56,7 +56,7 @@ public class ChatChannelController_Mock: ChatChannelController {
}

var createNewMessageCallCount = 0
public override func createNewMessage(
override func createNewMessage(
messageId: MessageId? = nil,
text: String, pinning: MessagePinning? = nil,
isSilent: Bool = false,
Expand All @@ -71,61 +71,61 @@ public class ChatChannelController_Mock: ChatChannelController {
createNewMessageCallCount += 1
}

public var hasLoadedAllNextMessages_mock: Bool? = true
public override var hasLoadedAllNextMessages: Bool {
var hasLoadedAllNextMessages_mock: Bool? = true
override var hasLoadedAllNextMessages: Bool {
hasLoadedAllNextMessages_mock ?? super.hasLoadedAllNextMessages
}

public var hasLoadedAllPreviousMessages_mock: Bool? = true
public override var hasLoadedAllPreviousMessages: Bool {
var hasLoadedAllPreviousMessages_mock: Bool? = true
override var hasLoadedAllPreviousMessages: Bool {
hasLoadedAllPreviousMessages_mock ?? super.hasLoadedAllPreviousMessages
}

public var markedAsUnread_mock: Bool? = true
public override var isMarkedAsUnread: Bool {
var markedAsUnread_mock: Bool? = true
override var isMarkedAsUnread: Bool {
markedAsUnread_mock ?? super.isMarkedAsUnread
}

public var channel_mock: ChatChannel?
override public var channel: ChatChannel? {
var channel_mock: ChatChannel?
override var channel: ChatChannel? {
channel_mock ?? super.channel
}

public var channelQuery_mock: ChannelQuery?
public override var channelQuery: ChannelQuery {
var channelQuery_mock: ChannelQuery?
override var channelQuery: ChannelQuery {
channelQuery_mock ?? super.channelQuery
}

public var messages_mock: [ChatMessage]?
override public var messages: LazyCachedMapCollection<ChatMessage> {
var messages_mock: [ChatMessage]?
override var messages: LazyCachedMapCollection<ChatMessage> {
messages_mock.map { $0.lazyCachedMap { $0 } } ?? super.messages
}

public var markReadCallCount = 0
public override func markRead(completion: ((Error?) -> Void)?) {
var markReadCallCount = 0
override func markRead(completion: ((Error?) -> Void)?) {
markReadCallCount += 1
}

public var state_mock: State?
override public var state: DataController.State {
var state_mock: State?
override var state: DataController.State {
get { state_mock ?? super.state }
set { super.state = newValue }
}

public private(set) var synchronize_completion: ((Error?) -> Void)?
override public func synchronize(_ completion: ((Error?) -> Void)? = nil) {
private(set) var synchronize_completion: ((Error?) -> Void)?
override func synchronize(_ completion: ((Error?) -> Void)? = nil) {
synchronize_completion = completion
}

public var loadFirstPageCallCount = 0
public var loadFirstPage_result: Error?
public override func loadFirstPage(_ completion: ((Error?) -> Void)? = nil) {
var loadFirstPageCallCount = 0
var loadFirstPage_result: Error?
override func loadFirstPage(_ completion: ((Error?) -> Void)? = nil) {
loadFirstPageCallCount += 1
completion?(loadFirstPage_result)
}

public var loadPageAroundMessageIdCallCount = 0
public override func loadPageAroundMessageId(
var loadPageAroundMessageIdCallCount = 0
override func loadPageAroundMessageId(
_ messageId: MessageId,
limit: Int? = nil,
completion: ((Error?) -> Void)? = nil
Expand All @@ -134,7 +134,7 @@ public class ChatChannelController_Mock: ChatChannelController {
}
}

public extension ChatChannelController_Mock {
extension ChatChannelController_Mock {
/// Simulates the initial conditions. Setting these values doesn't trigger any observer callback.
func simulateInitial(channel: ChatChannel, messages: [ChatMessage], state: DataController.State) {
channel_mock = channel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,40 @@
import Foundation
@testable import StreamChat

public class ChatChannelListController_Mock: ChatChannelListController, Spy {
public let spyState = SpyState()
public var loadNextChannelsIsCalled = false
public var loadNextChannelsCallCount = 0
public var resetChannelsQueryResult: Result<(synchedAndWatched: [ChatChannel], unwanted: Set<ChannelId>), Error>?
public var refreshLoadedChannelsResult: Result<Set<ChannelId>, any Error>?
class ChatChannelListController_Mock: ChatChannelListController, Spy {
let spyState = SpyState()
var loadNextChannelsIsCalled = false
var loadNextChannelsCallCount = 0
var resetChannelsQueryResult: Result<(synchedAndWatched: [ChatChannel], unwanted: Set<ChannelId>), Error>?
var refreshLoadedChannelsResult: Result<Set<ChannelId>, any Error>?

/// Creates a new mock instance of `ChatChannelListController`.
public static func mock(client: ChatClient? = nil) -> ChatChannelListController_Mock {
static func mock(client: ChatClient? = nil) -> ChatChannelListController_Mock {
.init(query: .init(filter: .equal(.memberCount, to: 0)), client: client ?? .mock())
}

public var channels_mock: [ChatChannel]?
override public var channels: LazyCachedMapCollection<ChatChannel> {
var channels_mock: [ChatChannel]?
override var channels: LazyCachedMapCollection<ChatChannel> {
channels_mock.map { $0.lazyCachedMap { $0 } } ?? super.channels
}

public var state_mock: State?
override public var state: DataController.State {
var state_mock: State?
override var state: DataController.State {
get { state_mock ?? super.state }
set { super.state = newValue }
}

override public func loadNextChannels(limit: Int?, completion: ((Error?) -> Void)?) {
override func loadNextChannels(limit: Int?, completion: ((Error?) -> Void)?) {
loadNextChannelsCallCount += 1
loadNextChannelsIsCalled = true
}

override public func refreshLoadedChannels(completion: @escaping (Result<Set<ChannelId>, any Error>) -> Void) {
override func refreshLoadedChannels(completion: @escaping (Result<Set<ChannelId>, any Error>) -> Void) {
record()
refreshLoadedChannelsResult.map(completion)
}

override public func resetQuery(
override func resetQuery(
watchedAndSynchedChannelIds: Set<ChannelId>,
synchedChannelIds: Set<ChannelId>,
completion: @escaping (Result<(synchedAndWatched: [ChatChannel], unwanted: Set<ChannelId>), Error>) -> Void
Expand All @@ -48,7 +48,7 @@ public class ChatChannelListController_Mock: ChatChannelListController, Spy {
}
}

public extension ChatChannelListController_Mock {
extension ChatChannelListController_Mock {
/// Simulates the initial conditions. Setting these values doesn't trigger any observer callback.
func simulateInitial(channels: [ChatChannel], state: DataController.State) {
channels_mock = channels
Expand Down
Loading
Loading