Skip to content

Commit

Permalink
Merge pull request #1678 from bugsnag/tms/debug-mode
Browse files Browse the repository at this point in the history
Run e2e test in Debug configuration
  • Loading branch information
twometresteve authored Jul 10, 2024
2 parents 2e1c401 + 73c19cf commit 7b00975
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 43 deletions.
101 changes: 100 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ steps:

##############################################################################
#
# Basic build E2E tests
# Basic build E2E tests - Release Configuration
#

#
Expand Down Expand Up @@ -572,6 +572,105 @@ steps:
- exit_status: -1 # Agent was lost
limit: 2

##############################################################################
#
# Debug configration E2E tests
#

- label: ':browserstack: iOS 17 debug configuration tests'
depends_on:
- cocoa_fixture
timeout_in_minutes: 60
agents:
queue: opensource
plugins:
artifacts#v1.9.3:
download: "features/fixtures/ios/output/ipa_url_bs_debug.txt"
upload: "maze_output/failed/**/*"
docker-compose#v4.7.0:
pull: cocoa-maze-runner
run: cocoa-maze-runner
command:
- "--app=@/app/build/ipa_url_bs_debug.txt"
- "--farm=bs"
- "--device=IOS_17"
- "--fail-fast"
- "features/debug"
concurrency: 5
concurrency_group: 'browserstack-app'
concurrency_method: eager
retry:
automatic:
- exit_status: -1 # Agent was lost
limit: 2

- label: ':bitbar: iOS 13 debug configuration tests'
depends_on:
- cocoa_fixture
timeout_in_minutes: 60
agents:
queue: opensource
plugins:
artifacts#v1.9.3:
download: "features/fixtures/ios/output/ipa_url_bb_debug.txt"
upload: "maze_output/failed/**/*"
docker-compose#v4.7.0:
pull: cocoa-maze-runner-bitbar
run: cocoa-maze-runner-bitbar
service-ports: true
command:
- "--app=@/app/build/ipa_url_bb_debug.txt"
- "--farm=bb"
- "--device=IOS_13"
- "--no-tunnel"
- "--aws-public-ip"
- "--fail-fast"
- "features/debug"
concurrency: 25
concurrency_group: 'bitbar'
concurrency_method: eager
retry:
automatic:
- exit_status: -1 # Agent was lost
limit: 2

- label: 'macOS 14 debug E2E tests'
depends_on:
- cocoa_fixture
timeout_in_minutes: 10
agents:
queue: macos-14
plugins:
artifacts#v1.5.0:
download: "features/fixtures/macos/output/macOSTestApp_Debug.zip"
upload:
- "macOSTestApp.log"
- "maze_output/failed/**/*"
commands:
- bundle install
- bundle exec maze-runner
features/debug
--os=macos
--fail-fast

- label: 'macOS 10.13 debug E2E tests'
depends_on:
- cocoa_fixture
timeout_in_minutes: 10
agents:
queue: opensource-mac-cocoa-10.13
plugins:
artifacts#v1.5.0:
download: "features/fixtures/macos/output/macOSTestApp_Debug.zip"
upload:
- "macOSTestApp.log"
- "maze_output/failed/**/*"
commands:
- bundle install
- bundle exec maze-runner
features/debug
--os=macos
--fail-fast

##############################################################################
#
Expand Down
2 changes: 1 addition & 1 deletion features/release/crashprobe.feature
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Feature: Reporting crash events
And the "isPC" of stack frame 0 is true
And the "isLR" of stack frame 0 is null

# TODO: Skipped Pending PLAT-12396
# TODO: Skipped Pending PLAT-12398
@skip_macos
Scenario: Crash within Swift code
When I run "SwiftCrashScenario" and relaunch the crashed app
Expand Down
2 changes: 1 addition & 1 deletion features/release/delivery.feature
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Feature: Delivery of errors
And the event "usage.system.stringsTruncated" is not null

@skip_ios_17
# TODO: Skipped Pending PLAT-12396
# TODO: Skipped Pending PLAT-12398
@skip_macos
Scenario Outline: Attempt Delivery On Crash
When I set the app to "<scenario_mode>" mode
Expand Down
5 changes: 3 additions & 2 deletions features/scripts/export_ios_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if [ "$1" != "Release" ] && [ "$1" != "Debug" ]; then
exit 1
fi

BUILD_CONFIGURATION=$1
pushd features/fixtures/ios

echo "--- iOSTestApp: xcodebuild archive"
Expand All @@ -21,7 +22,7 @@ pushd features/fixtures/ios
-scheme iOSTestApp \
-workspace iOSTestApp.xcworkspace \
-destination generic/platform=iOS \
-configuration $1 \
-configuration ${BUILD_CONFIGURATION} \
-archivePath archive/iosTestApp.xcarchive \
-allowProvisioningUpdates \
-quiet \
Expand All @@ -40,6 +41,6 @@ pushd features/fixtures/ios
-exportOptionsPlist exportOptions.plist

pushd output
mv iOSTestApp.ipa iOSTestApp_$1.ipa
mv iOSTestApp.ipa iOSTestApp_$BUILD_CONFIGURATION.ipa
popd
popd
78 changes: 40 additions & 38 deletions features/scripts/export_mac_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,49 @@ if [ "$1" != "Release" ] && [ "$1" != "Debug" ]; then
exit 1
fi

cd features/fixtures/macos

echo "--- macOSTestApp: pod install"

pod install

echo "--- macOSTestApp: xcodebuild archive"

BUILD_ARGS=(
-workspace macOSTestApp.xcworkspace
-scheme macOSTestApp
-destination generic/platform=macOS
-configuration Release
-archivePath archive/macOSTestApp.xcarchive
-quiet
archive
ONLY_ACTIVE_ARCH=NO
)

if [ "${ENABLE_CODE_COVERAGE:-}" = YES ]; then
BUILD_ARGS+=(
OTHER_CFLAGS='$(inherited) -fprofile-instr-generate -fcoverage-mapping'
OTHER_LDFLAGS='$(inherited) -fprofile-instr-generate'
OTHER_SWIFT_FLAGS='$(inherited) -profile-generate -profile-coverage-mapping'
)
fi
BUILD_CONFIGURATION=$1

xcodebuild "${BUILD_ARGS[@]}"
pushd features/fixtures/macos

echo "--- macOSTestApp: xcodebuild -exportArchive"
echo "--- macOSTestApp: pod install"

xcrun xcodebuild \
-exportArchive \
-exportPath output/ \
-exportOptionsPlist exportOptions.plist \
-archivePath archive/macOSTestApp.xcarchive \
-destination generic/platform=macOS \
-quiet
pod install

cd output
echo "--- macOSTestApp: xcodebuild archive"

echo "--- macOSTestApp: zip"
BUILD_ARGS=(
-workspace macOSTestApp.xcworkspace
-scheme macOSTestApp
-destination generic/platform=macOS
-configuration ${BUILD_CONFIGURATION}
-archivePath archive/macOSTestApp.xcarchive
-quiet
archive
ONLY_ACTIVE_ARCH=NO
)

zip -qr macOSTestApp_$1.zip macOSTestApp.app
if [ "${ENABLE_CODE_COVERAGE:-}" = YES ]; then
BUILD_ARGS+=(
OTHER_CFLAGS='$(inherited) -fprofile-instr-generate -fcoverage-mapping'
OTHER_LDFLAGS='$(inherited) -fprofile-instr-generate'
OTHER_SWIFT_FLAGS='$(inherited) -profile-generate -profile-coverage-mapping'
)
fi

xcodebuild "${BUILD_ARGS[@]}"

echo "--- macOSTestApp: xcodebuild -exportArchive"

xcrun xcodebuild \
-exportArchive \
-exportPath output/ \
-exportOptionsPlist exportOptions.plist \
-archivePath archive/macOSTestApp.xcarchive \
-destination generic/platform=macOS \
-quiet

pushd output
echo "--- macOSTestApp: zip"
zip -qr macOSTestApp_$BUILD_CONFIGURATION.zip macOSTestApp.app
popd
popd

0 comments on commit 7b00975

Please sign in to comment.