-
Notifications
You must be signed in to change notification settings - Fork 233
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
[SDK-2480] Created initial MobileBoost test apps and Github Actions #1461
Closed
Closed
Changes from 15 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
9e69713
Added workflows and updated testbed
nsingh-branch 49f987f
Update run-mobileboost-tests.yml
nsingh-branch 53c2b92
Added force quit button
nsingh-branch 5250d1e
Merge branch 'master' into mobileboost
nsingh-branch 4c4c1b4
Added Testbeds
nsingh-branch fe67171
Update script
nsingh-branch e6febc8
Merge branch 'master' into mobileboost
nsingh-branch 89ac7b8
Folder name change
nsingh-branch d27a193
Fixed script
nsingh-branch 6ed786c
Updated when the action is run
nsingh-branch 9a311a8
Moved framework
nsingh-branch 1b234ff
Cleaned up appIcons and framework
nsingh-branch 5497a5d
Removed userdefaulthelper
nsingh-branch 340b47d
Merge branch 'master' into mobileboost
nsingh-branch 811f932
Updated version number
nsingh-branch 4bcc50f
Updated Deployment Target
NidhiDixit09 11fe1a5
Fixed App compilation issues
NidhiDixit09 c061b62
Added workflow trigger type - push temp for easy testing.
NidhiDixit09 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 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,88 @@ | ||
name: Receive MobileBoost Results | ||
|
||
on: | ||
repository_dispatch: | ||
types: [mobileboost-results] | ||
|
||
jobs: | ||
process-results: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Process results | ||
id: process_results | ||
run: | | ||
import json | ||
import os | ||
|
||
# Get the JSON payload from the webhook | ||
payload = ${{ toJson(github.event.client_payload) }} | ||
|
||
# Process the results | ||
total_tests = payload['totalTests'] | ||
failed_tests = payload['failedTests'] | ||
app_info = payload['appInfo'] | ||
app_version = f"{payload['appVersionName']} ({payload['appVersionCode']})" | ||
platform = payload['platform'] | ||
|
||
# Create the Slack message blocks | ||
blocks = [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": f"MobileBoost Test Results for {app_info}", | ||
"emoji": True | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{"type": "mrkdwn", "text": f"*Platform:* {platform.capitalize()}"}, | ||
{"type": "mrkdwn", "text": f"*Version:* {app_version}"}, | ||
{"type": "mrkdwn", "text": f"*Total Tests:* {total_tests}"}, | ||
{"type": "mrkdwn", "text": f"*Failed Tests:* {len(failed_tests)}"} | ||
] | ||
} | ||
] | ||
|
||
if failed_tests: | ||
blocks.append({"type": "divider"}) | ||
blocks.append({ | ||
"type": "section", | ||
"text": {"type": "mrkdwn", "text": "*Failed Tests:*"} | ||
}) | ||
for test in failed_tests: | ||
blocks.append({ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": f"• <{test['recording']}|{test['title']}>\n" | ||
f" Device: {test['device']} ({test['os']})\n" | ||
f" Error: {test['statusMessage']}" | ||
} | ||
}) | ||
else: | ||
blocks.append({ | ||
"type": "section", | ||
"text": {"type": "mrkdwn", "text": "All tests passed successfully! 🎉"} | ||
}) | ||
|
||
# Set output for the next step | ||
print(f"::set-output name=slack_payload::{json.dumps({'blocks': blocks})}") | ||
shell: python | ||
|
||
- name: Send message to Slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: "C07JDKLFU8N" | ||
payload: ${{ steps.process_results.outputs.slack_payload }} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
This file contains 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,88 @@ | ||
name: Run MobileBoost Tests on PR | ||
on: | ||
pull_request: | ||
types: [opened, reopened] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build Main Branch-TestBed | ||
run: | | ||
xcodebuild -project Branch-TestBed/Branch-TestBed.xcodeproj \ | ||
-scheme Branch-TestBed \ | ||
-sdk iphonesimulator \ | ||
-configuration Debug \ | ||
-derivedDataPath $PWD/build \ | ||
clean build | ||
|
||
- name: Build DelayedInitTest | ||
run: | | ||
ls | ||
xcodebuild -project Linking-TestBeds/DelayedInitTest/DelayedInitTest.xcodeproj/ \ | ||
-scheme DelayedInitTest \ | ||
-sdk iphonesimulator \ | ||
-configuration Debug \ | ||
-derivedDataPath $PWD/build_delayed \ | ||
clean build | ||
|
||
- name: Build ScenesTest | ||
run: | | ||
xcodebuild -project Linking-TestBeds/ScenesTest/ScenesTest.xcodeproj \ | ||
-scheme ScenesTest \ | ||
-sdk iphonesimulator \ | ||
-configuration Debug \ | ||
-derivedDataPath $PWD/build_scenes \ | ||
clean build | ||
|
||
- name: Build SwiftUITest | ||
run: | | ||
xcodebuild -project Linking-TestBeds/SwiftUITest/SwiftUITest.xcodeproj \ | ||
-scheme SwiftUITest \ | ||
-sdk iphonesimulator \ | ||
-configuration Debug \ | ||
-derivedDataPath $PWD/build_swiftui \ | ||
clean build | ||
|
||
- name: Compress Main Branch-TestBed | ||
run: | | ||
cd $PWD/build/Build/Products/Debug-iphonesimulator/ | ||
zip -r Branch-TestBed.app.zip Branch-TestBed.app | ||
|
||
- name: Compress DelayedInitTest | ||
run: | | ||
cd $PWD/build_delayed/Build/Products/Debug-iphonesimulator/ | ||
zip -r DelayedInitTest.app.zip DelayedInitTest.app | ||
|
||
- name: Compress ScenesTest | ||
run: | | ||
cd $PWD/build_scenes/Build/Products/Debug-iphonesimulator/ | ||
zip -r ScenesTest.app.zip ScenesTest.app | ||
|
||
- name: Compress SwiftUITest | ||
run: | | ||
cd $PWD/build_swiftui/Build/Products/Debug-iphonesimulator/ | ||
zip -r SwiftUITest.app.zip SwiftUITest.app | ||
|
||
- name: Upload builds to Mobile Boost and Run Tests | ||
run: | | ||
echo "Uploading Branch-TestBed..." | ||
curl -s https://app.mobileboost.io/cli.sh | tr -d '\r' | /bin/bash -s -- "$PWD/build/Build/Products/Debug-iphonesimulator/Branch-TestBed.app.zip" ios | ||
|
||
echo "Uploading DelayedInitTest.app.zip..." | ||
curl -s https://app.mobileboost.io/cli.sh | tr -d '\r' | /bin/bash -s -- "$PWD/build_delayed/Build/Products/Debug-iphonesimulator/DelayedInitTest.app.zip" ios | ||
|
||
echo "Uploading ScenesTest.app.zip..." | ||
curl -s https://app.mobileboost.io/cli.sh | tr -d '\r' | /bin/bash -s -- "$PWD/build_scenes/Build/Products/Debug-iphonesimulator/ScenesTest.app.zip" ios | ||
|
||
echo "Uploading SwiftUITest.app.zip..." | ||
curl -s https://app.mobileboost.io/cli.sh | tr -d '\r' | /bin/bash -s -- "$PWD/build_swiftui/Build/Products/Debug-iphonesimulator/SwiftUITest.app.zip" ios | ||
env: | ||
API_ORG_KEY: ${{ secrets.MOBILEBOOST_API_ORG_KEY }} | ||
API_KEY: ${{ secrets.MOBILEBOOST_API_ORG_KEY }} | ||
TEST_TAGS: Test | ||
shell: bash |
This file contains 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 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.
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.
Tests are not happy with this change
XCTAssertEqualObjects(application.displayVersionString, @"1.1");