-
Notifications
You must be signed in to change notification settings - Fork 227
[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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
|
|
||
| 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 }}" | ||
| 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/* | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "configurations" : [ | ||
| { | ||
| "id" : "2125E461-58C7-480E-9DB9-4CF3B51D3C5C", | ||
| "name" : "Configuration 1", | ||
| "options" : { | ||
|
|
||
| } | ||
| } | ||
| ], | ||
| "defaultOptions" : { | ||
|
|
||
| }, | ||
| "testTargets" : [ | ||
| { | ||
| "selectedTests" : [ | ||
| "Backend_Tests\/test_message()", | ||
| "Backend_Tests\/test_reaction()" | ||
| ], | ||
| "target" : { | ||
| "containerPath" : "container:StreamChat.xcodeproj", | ||
| "identifier" : "A34407DB27D8C3400044F150", | ||
| "name" : "StreamChatUITestsAppUITests" | ||
| } | ||
| } | ||
| ], | ||
| "version" : 1 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,8 @@ | |
| "testTargets" : [ | ||
| { | ||
| "skippedTests" : [ | ||
| "Backend_Tests", | ||
| "Backend_Tests\/test_messageListUpdates_whenUserSendsMessage()", | ||
|
Comment on lines
+23
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Test method doesn't exist. Line 24 references If you only want to skip the entire Backend_Tests suite (which makes sense since they run in a separate test plan), remove the specific test reference: "skippedTests" : [
"Backend_Tests",
- "Backend_Tests\/test_messageListUpdates_whenUserSendsMessage()",
"ChannelListScrollTime",
"MessageListScrollTime"
],🤖 Prompt for AI Agents |
||
| "ChannelListScrollTime", | ||
| "MessageListScrollTime" | ||
| ], | ||
|
|
||
| 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) | ||
| } | ||
| } | ||
| } |
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.
Remove TODO or define the trigger intention.
The TODO comment suggests this
pull_requesttrigger is temporary for testing. Either remove it before merging or clarify the intended trigger conditions for this workflow.🤖 Prompt for AI Agents