-
Notifications
You must be signed in to change notification settings - Fork 228
[CI] Introduce Backend Integration Tests #3876
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dc07ea8
[CI] Introduce Backend Integration Tests
testableapple acbd281
Test on PR
testableapple 95a862a
Fix typo
testableapple 33d0d1c
Fix arg
testableapple 61bde1f
Include tests
testableapple f882fb8
Fix test pack
testableapple a63eb94
Revert "Test on PR"
testableapple dec0450
Merge branch 'develop' into ci/backend-tests
testableapple File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: Backend Checks | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| pull_request: #TODO: DELETE AFTER TESTING | ||
testableapple marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI | ||
| IOS_SIMULATOR_DEVICE: "iPhone 16 Pro (18.5)" | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| jobs: | ||
| test-backend-integration: | ||
| name: Test Backend Integration | ||
| runs-on: macos-15 | ||
| steps: | ||
| - uses: actions/[email protected] | ||
| - uses: ./.github/actions/bootstrap | ||
| env: | ||
| INSTALL_YEETD: true | ||
| SKIP_SWIFT_BOOTSTRAP: true | ||
| - name: Run UI Tests (Debug) | ||
| run: bundle exec fastlane test_e2e device:"${{ env.IOS_SIMULATOR_DEVICE }}" batch:'${{ matrix.batch }}' | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| timeout-minutes: 100 | ||
| - name: Parse xcresult | ||
| if: failure() | ||
| run: | | ||
| brew install chargepoint/xcparse/xcparse | ||
| xcparse logs fastlane/test_output/StreamChatUITestsApp.xcresult fastlane/test_output/logs/ | ||
| - uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: Test Data Backend Integration | ||
| path: | | ||
| fastlane/recordings | ||
| fastlane/sinatra_log.txt | ||
| fastlane/test_output/logs/*/Diagnostics/**/*.txt | ||
| fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "configurations" : [ | ||
| { | ||
| "id" : "2125E461-58C7-480E-9DB9-4CF3B51D3C5C", | ||
| "name" : "Configuration 1", | ||
| "options" : { | ||
|
|
||
| } | ||
| } | ||
| ], | ||
| "defaultOptions" : { | ||
|
|
||
| }, | ||
| "testTargets" : [ | ||
| { | ||
| "selectedTests" : [ | ||
| "Backend_Tests\/test_messageListUpdates_whenUserSendsMessage()" | ||
| ], | ||
testableapple marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "target" : { | ||
| "containerPath" : "container:StreamChat.xcodeproj", | ||
| "identifier" : "A34407DB27D8C3400044F150", | ||
| "name" : "StreamChatUITestsAppUITests" | ||
| } | ||
| } | ||
| ], | ||
| "version" : 1 | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
StreamChatUITestsAppUITests/Tests/Backend/Backend_Tests.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| // | ||
| // Copyright © 2025 Stream.io Inc. All rights reserved. | ||
| // | ||
|
|
||
| import XCTest | ||
|
|
||
| final class Backend_Tests: StreamTestCase { | ||
| override func setUpWithError() throws { | ||
| mockServerEnabled = false | ||
| switchApiKey = "8br4watad788" | ||
| try super.setUpWithError() | ||
| } | ||
|
|
||
| func test_message() { | ||
| let originalMessage = "hi" | ||
| let editedMessage = "hello" | ||
|
|
||
| GIVEN("user opens the channel") { | ||
| userRobot | ||
| .login() | ||
| .openChannel() | ||
| } | ||
| WHEN("user sends a message") { | ||
| userRobot.sendMessage(originalMessage) | ||
| } | ||
| THEN("message appears") { | ||
| userRobot.assertMessage(originalMessage) | ||
| } | ||
| WHEN("user edits the message") { | ||
| userRobot.editMessage(editedMessage) | ||
| } | ||
| THEN("the message is edited") { | ||
| userRobot.assertMessage(editedMessage) | ||
| } | ||
| WHEN("user deletes the message") { | ||
| userRobot.deleteMessage() | ||
| } | ||
| THEN("the message is deleted") { | ||
| userRobot.assertDeletedMessage() | ||
| } | ||
| } | ||
|
|
||
| func test_reaction() throws { | ||
| let message = "test" | ||
|
|
||
| GIVEN("user opens the channel") { | ||
| userRobot.login().openChannel() | ||
| } | ||
| WHEN("user sends the message: '\(message)'") { | ||
| userRobot.sendMessage(message) | ||
| } | ||
| AND("user adds the reaction") { | ||
| userRobot | ||
| .addReaction(type: .like) | ||
| .waitForNewReaction() | ||
| } | ||
| THEN("the reaction is added") { | ||
| userRobot.assertReaction(isPresent: true) | ||
| } | ||
| AND("user removes the reaction") { | ||
| userRobot.deleteReaction(type: .like) | ||
| } | ||
| THEN("the reaction is removed") { | ||
| userRobot.assertReaction(isPresent: false) | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be possible for the backend team to run this workflow independently on demand, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, https://github.com/GetStream/stream-chat-swift/actions/workflows/backend-checks.yml