Commit Graph

203 Commits

Author SHA1 Message Date
Stefan Ceriu 8a3468658b Address PR comments 2026-08-21 12:26:02 +03:00
Stefan Ceriu 0bd571d068 Relaunch the test process on retrying after failures.
So that runner exits continue the retry flows.
2026-08-21 12:26:02 +03:00
Stefan Ceriu cd453bc6fa Move xcresultparser to the Tools to avoid long recompilation times through brew 2026-08-19 07:41:26 +03:00
Stefan Ceriu 771d10ac6b Cache CI test run compilations 2026-08-19 07:41:26 +03:00
Stefan Ceriu e302b37b6a Move Variants into the Components folder
Continue grouping the standalone modules under Components. Updates the
nightly.yml include path and the app icon banner path used by the
configure-nightly CI command.
2026-08-12 16:52:26 +03:00
Stefan Ceriu 5866c4340a Move SDKMocks into the Components folder
Group the standalone modules that live outside of the app targets under a
single Components folder. Updates the XcodeGen include, the Codecov ignore
path and the Sourcery output path used by the generate-sdk-mocks tool.
2026-08-12 16:52:26 +03:00
Stefan Ceriu 1febb3ef91 Retry failed XCUITests 2026-08-11 19:51:33 +03:00
Stefan Ceriu 42a7b6e8ee Annotate failures for Github Actions so they're easier to spot. 2026-08-10 20:33:43 +03:00
Stefan Ceriu 0856fdc146 Improve integration test diagnostics in an attempt to catch run crashes 2026-08-10 13:19:41 +03:00
Mauro 9093631f8b Periphery cleanup (#5893) 2026-07-20 11:16:11 +02:00
Mauro 0be5693779 Constrained tests tool implementation + skill (#5873)
* constrained tests tool implementation + skill

* pr suggestions
2026-07-15 12:17:51 +02:00
Doug 5915713a02 Introduce a build setting to detect Nightly builds. (#5852)
* Allow the AppIconBanner tool to be called with purely the build number.

And use that for the Element Pro Nightly.

* Use a build setting to determine Nightly builds.
2026-07-09 13:56:26 +01:00
Doug 81b33da6ab Switch back to using the stable version of SwiftFormat. (#5850) 2026-07-08 11:01:55 +01:00
Mauro 2d486ece33 Use iOS 26 Observation for Unit and Preview tests. (#5797)
* use observation in unit and preview tests instead of the async stream

* use a parsing approach that is independent of the sourcery annotation

* Fix observation deferred fulfillments not receiving the initial value

Observation's observe only emits transitions, not the value present at subscription time. Drop the leading initial value from the affected transitionValues sequences and assert it directly with #expect instead.

* improved docs
2026-06-30 14:01:08 +02:00
Doug 59ba4a238e Fix macros on CI.
The explicit SDK usage means macros fail to compile for macOS. The SDK will be inferred by the destination platform.
Note: We no longer use a plugin so I've remove that argument too.
2026-06-29 10:34:32 +01:00
Mauro a520d94760 Swift 6 Migration (#5733)
* Enable Swift 6.2 with default main actor isolation for the app target

Turn on SWIFT_VERSION 6.2, SWIFT_APPROACHABLE_CONCURRENCY and SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor for the ElementX target, matching the NSE and Share Extension (which already use 6.2 without the main actor default).

# Conflicts:
#	ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

* Update the code generation templates for Swift 6

Emit nonisolated/@unchecked Sendable mocks and nonisolated string enums, and mark async mock methods @concurrent so they keep suspending like the real implementations (otherwise intermediate states are unobservable in tests). Includes the regenerated mocks and strings.

# Conflicts:
#	ElementX/Sources/Mocks/Generated/GeneratedMocks.swift

* Make the data layer and services nonisolated and Sendable

Annotate the value-type models, Rust SDK proxy wrappers, timeline item graph, settings, logging and NSE-shared types as nonisolated, and conform the service protocols to Sendable so their existentials can cross isolation boundaries. These types run off the main actor and no longer inherit the target's default main actor isolation.

* Adopt the new isolation across call sites, mocks and signatures

Update call sites, closure signatures and mock configuration helpers to match the nonisolated/Sendable data layer, including the main actor isolated mock inits and the @Sendable filter on recentlyVisitedRooms.

^ Conflicts:
^	ElementX/Sources/Services/SecureBackup/SecureBackupController.swift

* Remove redundant @MainActor annotations

With the app target defaulting to main actor isolation, the explicit @MainActor on view models, coordinators, views and their protocols is no longer required.

* Fix concurrency hotspots surfaced by the migration

Resolve the room summary main-thread deadlock by moving diff processing onto AsyncStreams, add the SDKListener.onMainActor FIFO bridge for SDK callbacks, hop KVO/timer/UIKit callbacks to the main actor via assumeIsolated, add isolated deinits, and apply the few justified nonisolated(unsafe) escapes for queue-confined Apple APIs.

* Fix the unit tests for Swift 6 concurrency

Hop the waitForConfirmation body onto the caller's actor (Swift Testing runs confirmation closures off-actor), and adjust the affected suites and async signatures.

* offload diffs on concurrent threads instead of main actor

* make room info protocols sendable

* use a task group for fetching data so that everything runs concurrently in the TextRoomTimelineView when getting the preview.

* use the generic onMainActor implementation, which already makes a stream and send the continuation on the main actor.

* small pr comments issues being addressed

* update enterprise

* Update StaticCode to 1.1.0 and specify the required Swift isolation.

* fix ElementCallServiceTests

* update enterprise

* re-generate mocks

* update enterprise

* enterprise new code conformed to swift 6

---------

Co-authored-by: Doug <douglase@element.io>
2026-06-18 17:55:31 +02:00
Mauro ad6ae390d1 use swift 6.2 for dev tools (#5720) 2026-06-09 10:46:29 +02:00
Stefan Ceriu 2fddb597b8 Bump the CI workflows to iOS 26.5, centralise default OS version 2026-06-08 19:54:07 +03:00
Stefan Ceriu c6d2c6b025 Switch the mock stencil templates to use NSLock instead of dispatch queues 2026-06-03 08:57:04 +03:00
Doug fa67713726 Run SwiftFormat. 2026-05-27 17:11:42 +01:00
Doug 5138e05e47 Use SwiftFormat from develop and enabled indent-blank-lines option. 2026-05-27 17:11:42 +01:00
Michael 22d14ff8e4 AppSettings are Mockable (#5589)
* create DependenciesProtocol and replace ServiceLocator registration with it

replace mocking calls for ServiceLocator to Dependencies

replace ServiceLocator with instance level calls

replace ServiceLocator configs with TestDependencies config in Tests

replace servicelocator usage in analytics service

replace remaining ServiceLocator calls in unit tests

that depended on the UnitTestAppCoordinator configuration with per suite dependencies instances

fix swiftlint warning

remove remaining references to ServiceLocator

make dependencies properties consistent in tests

delete Dependencies and DependenciesProtocol

fix whitespace modifications

updates from PR feedback

a pass over converting AppSettings and AnalyticsService test instance properties to per test instantiation

fix a missed PR feedback

Sync up after rebase

create DependenciesProtocol and replace ServiceLocator registration with it

replace mocking calls for ServiceLocator to Dependencies

replace ServiceLocator with instance level calls

replace ServiceLocator configs with TestDependencies config in Tests

replace servicelocator usage in analytics service

replace remaining ServiceLocator calls in unit tests

that depended on the UnitTestAppCoordinator configuration with per suite dependencies instances

fix swiftlint warning

remove remaining references to ServiceLocator

make dependencies properties consistent in tests

delete Dependencies and DependenciesProtocol

* AppSettings is instance level mockable now

* replace mocked and preview usages of reset + AppSettings global init with

AppSettings(store: UserDefaultsMock())

* AppSettings.UserDefaultsKeys is now a RawRep struct, making it extensible

* update tests with new AppSettings so it builds

* update remaining AppSettings test/mock inits

* AppSettings.UserDefaultsKey conformed to ExpressibleByStringLiteral

* addressed issues found in first pass ai review

* update AppSettings instantiations after rebase

* fix accessibility tests coordinator after rebase

* Rename to VolatileUserDefaults

* AppSettings init uses mandatory parameter

* Revert UserDefaultsKey to enum

* Add TrackedUserDefaults to be able to reset the defaults object

* Added volatile static func to AppSettings

* Use .volatile() static func instead of full init

* review fixups

* Resolve build issues after rebase

* updated enterprise module

* remove the static reset settings call from the preview tests

---------

Co-authored-by: Mauro Romito <mauro.romito@element.io>
2026-05-22 15:14:08 +02:00
Doug af44833850 Show which test suite failed in the UnitTest logs. 2026-05-04 14:03:28 +03:00
Mauro Romito fa801b5791 splitting runtime sim version from the os version 2026-04-27 14:13:13 +02:00
Mauro Romito 04202676aa use the default preview tests configuration 2026-04-27 14:13:13 +02:00
Mauro Romito 078c249262 use 26.4 os version on SE 3rd gen for preview tests 2026-04-27 14:13:13 +02:00
Mauro a9fae7b4e7 update sim version to 26.4.1 (#5479) 2026-04-24 11:59:15 +02:00
Stefan Ceriu 751ea16b0d Add a snapshot re-recording option to the snapshot tests CI command. 2026-04-20 11:54:44 +03:00
Stefan Ceriu f6fe112789 Split out the preview tests from the unit tests and move them to their own CI tool. 2026-04-20 11:54:44 +03:00
Doug 683c05019e Move the Acknowledgements generation to the post-renovate workflow. (#5438)
* Move the Acknowledgements generation to the post-renovate workflow.

* Use macOS 26.
2026-04-17 14:26:08 +01:00
Doug 63422f8f6b Upgrade the project to use Xcode 26.4 (and the 26.4 simulator for tests). (#5375)
* Upgrade the project to use Xcode 26.4 (and iOS 26.4 when running tests).

* Update the test OS assertions.

* updated preview tests

# Conflicts:
#	PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenInviteCell.iPhone-en-GB-0.png
#	PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenInviteCell.iPhone-pseudo-0.png

* update compound preview tests

---------

Co-authored-by: Mauro Romito <mauro.romito@element.io>
2026-04-16 14:33:20 +02:00
Mauro Romito 8b2d83f068 use swift regex and also apply the same logic to stringsdict 2026-04-10 16:21:57 +02:00
Mauro Romito 11dd6f0323 order strings alphabetically by key after downloading them 2026-04-10 16:21:57 +02:00
Stefan Ceriu df7914d052 Fix template screen ElementNavigationStack errors 2026-03-31 18:21:14 +03:00
Doug 8ce6f1f0d3 Really fix the release script. 2026-03-24 19:45:07 +00:00
Doug 86cea87c0f Fix the release script. 2026-03-24 17:06:44 +00:00
Stefan Ceriu c18eb92145 Revert "Move CI GitHub token usage to the global git configuration"
This reverts commit 519cd4052d.
2026-03-19 08:59:30 +02:00
Stefan Ceriu 519cd4052d Move CI GitHub token usage to the global git configuration 2026-03-13 16:57:01 +02:00
Copilot ac56a0ba43 Fix screen template unit tests to use Swift Testing conventions (#5187) 2026-03-11 15:20:21 +00:00
Stefan Ceriu bce9119bc3 Replace the last of the fastlane lanes with swift tooling
- move more sharable code to CI static methods
- merge `release_to_github` and `prepare_next_release` into one single command as they had dependencies on each other
- remove all traces of ruby and fastlane
2026-03-11 10:06:44 +02:00
Doug f8039e274b Actually fix the post-build command. 2026-03-05 17:41:24 +00:00
Doug 0d4ff5ea87 Fix the post-build command. 2026-03-05 17:08:54 +00:00
Stefan Ceriu e23959a201 Convert more fastlane tools to swift commands (#5163)
* Upload dSYMs to sentry using swift and the sentry-cli instead of fastlane.

* Replace the fastlane `config_production` lane with a swift tools `ConfigureProduction` command.

* Replace Zsh with CI.run in the new ConfigureNightly command

* Replace the fastlane `tag_nightly` lane with a swift tools `TagNightly` command.

* Print out all the commands going through CI.Run and their arguments

* Address PR comments
2026-03-05 16:14:09 +02:00
Stefan Ceriu 0ab6458e4e Fix new redundantSendable and redundantSwiftTestingSuite swiftformat errors 2026-03-04 17:02:11 +02:00
Stefan Ceriu 6dd9f3f5e9 Replace the enterprise unit tests workflow with the new swift ones 2026-03-02 12:34:58 +02:00
Stefan Ceriu 1b55fb224c Add swift command for running integration tests 2026-03-02 12:34:58 +02:00
Stefan Ceriu d3cefb8e0b Add swift command for running UI tests 2026-03-02 12:34:58 +02:00
Stefan Ceriu 1d8639a11a Replace the readMarketingVersion method with a cleaner Yams based one and extract it into the shared tools 2026-03-02 12:34:58 +02:00
Stefan Ceriu ef4a78ce53 Add swift command for running accessibility tests 2026-03-02 12:34:58 +02:00
Stefan Ceriu 0fc0e2880b Add a separate tools command for building nightly and remove the old fastlane one. 2026-02-26 18:43:49 +02:00