Skip to content
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

Add Xcode 13 support #500

Merged
merged 6 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 12.5
run: sudo xcode-select -s /Applications/Xcode_12.5.app
- name: Select Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh instance_tests1
- name: Capture xcresult files
Expand All @@ -29,8 +29,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 12.5
run: sudo xcode-select -s /Applications/Xcode_12.5.app
- name: Select Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh instance_tests2
- name: Capture xcresult files
Expand All @@ -48,8 +48,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 12.5
run: sudo xcode-select -s /Applications/Xcode_12.5.app
- name: Select Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh runner_tests
- name: Capture xcresult files
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 12.5
run: sudo xcode-select -s /Applications/Xcode_12.5.app
- name: Select Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh instance_tests1
- name: Capture xcresult files
Expand All @@ -34,8 +34,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 12.5
run: sudo xcode-select -s /Applications/Xcode_12.5.app
- name: Select Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh instance_tests2
- name: Capture xcresult files
Expand All @@ -53,8 +53,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 12.5
run: sudo xcode-select -s /Applications/Xcode_12.5.app
- name: Select Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh runner_tests
- name: Capture xcresult files
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 12.5
run: sudo xcode-select -s /Applications/Xcode_12.5.app
- name: Select Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh instance_tests1
- name: Capture xcresult files
Expand All @@ -32,8 +32,8 @@ jobs:
steps:
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
- name: Select Xcode 12.5
run: sudo xcode-select -s /Applications/Xcode_12.5.app
- name: Select Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh instance_tests2
- name: Capture xcresult files
Expand All @@ -54,8 +54,8 @@ jobs:
- name: Report event trigger data
run: |
echo "Event ${{ github.event_name }}, ref: ${{ github.ref }}"
- name: Select Xcode 12.5
run: sudo xcode-select -s /Applications/Xcode_12.5.app
- name: Select Xcode 13.0
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Run Bluepill tests
run: ./scripts/bluepill.sh runner_tests
- name: Capture xcresult files
Expand Down
2 changes: 1 addition & 1 deletion Configurations/common.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ DEPLOYMENT_LOCATION = YES
// Used by bluepill and bp to search for frameworks.
FRAMEWORK_SEARCH_PATHS = "/Library/Developer/PrivateFrameworks" "$(PRIVATE_FRAMEWORKS_DIR)" "$(DEVELOPER_PRIVATE_FRAMEWORKS_DIR)" "$(DEVELOPER_DIR)/Platforms/MacOSX.platform/Developer/Library/Frameworks" "$(DEVELOPER_DIR)/Library/PrivateFrameworks" "$(DEVELOPER_DIR)/../SharedFrameworks" "$(DEVELOPER_DIR)/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks"

OTHER_LDFLAGS = -weak_framework DVTFoundation -weak_framework DVTiPhoneSimulatorRemoteClient -weak_framework CoreSimulator -weak_framework XCTest -weak_framework DTXConnectionServices -weak_framework SimulatorKit
OTHER_LDFLAGS = -weak_framework DVTFoundation -weak_framework CoreSimulator -weak_framework XCTest -weak_framework DTXConnectionServices -weak_framework SimulatorKit
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ The exit code of Bluepill uses bit indicators which could represent multiple exi

## Requirements

Bluepill officially supports **Xcode 12.5**. If you're looking for old Xcode support, please checkout the following branches:
Bluepill officially supports **Xcode 13.0**. If you're looking for old Xcode support, please checkout the following branches:

* [Xcode-10.0](https://github.com/linkedin/bluepill/tree/xcode-10.0) | [Xcode-10.1](https://github.com/linkedin/bluepill/tree/xcode-10.1) | [Xcode-10.2](https://github.com/linkedin/bluepill/tree/xcode-10.2) | [Xcode-10.3](https://github.com/linkedin/bluepill/tree/xcode-10.3)
* [Xcode-11.0](https://github.com/linkedin/bluepill/tree/xcode-11.0) | [Xcode-11.1](https://github.com/linkedin/bluepill/tree/xcode-11.1) | [Xcode-11.2](https://github.com/linkedin/bluepill/tree/xcode-11.2) | [Xcode-11.3](https://github.com/linkedin/bluepill/tree/xcode-11.3) | [Xcode-11.4](https://github.com/linkedin/bluepill/tree/xcode-11.4) | [Xcode-11.5](https://github.com/linkedin/bluepill/tree/xcode-11.5)
* [Xcode-12.0](https://github.com/linkedin/bluepill/tree/xcode-12.0) | [Xcode-12.2](https://github.com/linkedin/bluepill/tree/xcode-12.2) | [Xcode-12.3](https://github.com/linkedin/bluepill/tree/xcode-12.3) | [Xcode-12.4](https://github.com/linkedin/bluepill/tree/xcode-12.4)
* [Xcode-12.0](https://github.com/linkedin/bluepill/tree/xcode-12.0) | [Xcode-12.2](https://github.com/linkedin/bluepill/tree/xcode-12.2) | [Xcode-12.3](https://github.com/linkedin/bluepill/tree/xcode-12.3) | [Xcode-12.4](https://github.com/linkedin/bluepill/tree/xcode-12.4) | [Xcode-12.5](https://github.com/linkedin/bluepill/tree/xcode-12.5)


If you're looking for newer Xcode version support, try using Bluepill with `unsafe-skip-xcode-version-check` flag but make sure your app is tested with it and the underlying risks are understand.
Expand Down
4 changes: 0 additions & 4 deletions bp/bp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1184,8 +1184,6 @@
"-weak_framework",
DVTFoundation,
"-weak_framework",
DVTiPhoneSimulatorRemoteClient,
"-weak_framework",
CoreSimulator,
"-weak_framework",
XCTest,
Expand Down Expand Up @@ -1219,8 +1217,6 @@
"-weak_framework",
DVTFoundation,
"-weak_framework",
DVTiPhoneSimulatorRemoteClient,
"-weak_framework",
CoreSimulator,
"-weak_framework",
XCTest,
Expand Down
6 changes: 3 additions & 3 deletions bp/src/BPConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#import <Foundation/Foundation.h>

#pragma mark - Version Constants
#define BP_DEFAULT_XCODE_VERSION "12.5"
#define BP_DEFAULT_RUNTIME "iOS 14.5"
#define BP_DEFAULT_BASE_SDK "14.5"
#define BP_DEFAULT_XCODE_VERSION "13.0"
#define BP_DEFAULT_RUNTIME "iOS 15.0"
#define BP_DEFAULT_BASE_SDK "15.0"

#define BP_DEFAULT_DEVICE_TYPE "iPhone 8"

Expand Down
2 changes: 1 addition & 1 deletion bp/src/BPUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ + (void)saveDebuggingDiagnostics:(NSString *)outputDirectory {
if (outputDirectory == nil || !([fm fileExistsAtPath:outputDirectory isDirectory:&isDir] && isDir)) {
return;
}
NSString *cmd = [NSString stringWithFormat:@"xcrun simctl diagnose -l -b --output='%@/diagnostics' --data-container", outputDirectory];
NSString *cmd = [NSString stringWithFormat:@"xcrun simctl diagnose -l -b --output='%@/diagnostics'", outputDirectory];
[BPUtils runShell:cmd];
cmd = [NSString stringWithFormat:@"ps axuw > '%@'/ps-axuw.log", outputDirectory];
[BPUtils runShell:cmd];
Expand Down
28 changes: 24 additions & 4 deletions bp/tests/BPReportTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,12 @@ - (void)testReportSuccessOnTestFailedAndPassOnRetry {
XCTAssertTrue(exitCode == BPExitStatusAllTestsPassed);
}

- (void)testReportWithFailingTestsSetAndDiagnostics {
- (void)testReportWithFailingTestsSet {
NSString *tempDir = NSTemporaryDirectory();
NSError *error;
NSString *outputDir = [BPUtils mkdtemp:[NSString stringWithFormat:@"%@/FailingTestsSetTempDir", tempDir] withError:&error];
// NSLog(@"output directory is %@", outputDir);
NSLog(@"output directory is %@", outputDir);
self.config.outputDirectory = outputDir;
self.config.saveDiagnosticsOnError = YES;
self.config.testCasesToSkip = @[@"BPAppNegativeTests/testBPDoesNotHangWithBigOutput"];
BPExitStatus exitCode = [[[Bluepill alloc ] initWithConfiguration:self.config] run];
// Make sure all tests started on the first run
Expand All @@ -433,6 +432,27 @@ - (void)testReportWithFailingTestsSetAndDiagnostics {
NSLog(@"Junit report: %@", junitReportPath);
NSString *expectedFilePath = [[[NSBundle bundleForClass:[self class]] resourcePath] stringByAppendingPathComponent:@"BPAppNegativeTests-results.xml"];
[self assertGotReport:junitReportPath isEqualToWantReport:expectedFilePath];
XCTAssert(exitCode == BPExitStatusTestsFailed);
}

/**
Execution plan: TIMEOUT, CRASH (not retried)
*/
- (void)testReportFailureOnTimeoutCrashAndPassWithDiagnostics {
self.config.stuckTimeout = @6;
self.config.testing_ExecutionPlan = @"TIMEOUT CRASH";
self.config.errorRetriesCount = @4;
self.config.onlyRetryFailed = TRUE;
NSString *tempDir = NSTemporaryDirectory();
NSError *error;
NSString *outputDir = [BPUtils mkdtemp:[NSString stringWithFormat:@"%@/FailingTestsSetTempDir", tempDir] withError:&error];
NSLog(@"output directory is %@", outputDir);
self.config.outputDirectory = outputDir;
self.config.saveDiagnosticsOnError = YES;
NSString *testBundlePath = [BPTestHelper sampleAppHangingTestsBundlePath];
self.config.testBundlePath = testBundlePath;

BPExitStatus exitCode = [[[Bluepill alloc ] initWithConfiguration:self.config] run];
NSFileManager *fm = [NSFileManager defaultManager];
[BPUtils runShell:[NSString stringWithFormat:@"find %@", outputDir]];
BOOL diagFileFound = [fm fileExistsAtPath:[NSString stringWithFormat:@"%@/diagnostics.tar.gz", outputDir]];
Expand All @@ -441,7 +461,7 @@ - (void)testReportWithFailingTestsSetAndDiagnostics {
XCTAssert(psFileFound);
BOOL dfFileFound = [fm fileExistsAtPath:[NSString stringWithFormat:@"%@/df-h.log", outputDir]];
XCTAssert(dfFileFound);
XCTAssert(exitCode == BPExitStatusTestsFailed);
XCTAssertTrue(exitCode == BPExitStatusAppCrashed);
}

#pragma mark - Test helpers
Expand Down
3 changes: 1 addition & 2 deletions bp/tests/Resource Files/fatal_tests_attempt_3.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Selected tests" tests="1" failures="0" errors="0">
<testsuite tests="1" failures="0" errors="0" name="BPSampleAppFatalErrorTests.xctest">
<testsuite tests="0" failures="0" errors="0" name="BPSampleAppFatalErrorTests"></testsuite>
ravimandala marked this conversation as resolved.
Show resolved Hide resolved
<testsuite tests="1" failures="0" errors="0" name="BPSampleAppSwiftFatalErrorTests">
<testcase classname="BPSampleAppSwiftFatalErrorTests" name="testZPass()" time="0.002000">
</testcase>
</testsuite>
</testsuite>
</testsuites>