Skip to content

Commit 01259e0

Browse files
Pavel Dusatkoobravimandala
authored
Add Xcode 13 support (#500)
* Add Xcode 13 support Signed-off-by: Pavel Dusatko <pdusatko@slack-corp.com> * Fix Xcode paths Signed-off-by: Pavel Dusatko <pdusatko@slack-corp.com> * Fix Xcode 13 path Signed-off-by: Oscar Bonilla <6f6231@gmail.com> * Updating the README with Xcode 12.5 branch Signed-off-by: Ravi Mandala <rmandala@linkedin.com> * Fixing a test and splitting a reporting diagnostics test Signed-off-by: Ravi Mandala <rmandala@linkedin.com> * Skipping data-container flag to significantly reduce the diagnostics archive size Signed-off-by: Ravi Mandala <rmandala@linkedin.com> Co-authored-by: Oscar Bonilla <6f6231@gmail.com> Co-authored-by: Ravi Mandala <rmandala@linkedin.com>
1 parent 913a8b3 commit 01259e0

File tree

10 files changed

+50
-35
lines changed

10 files changed

+50
-35
lines changed

.github/workflows/PR.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
steps:
1111
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
1212
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
13-
- name: Select Xcode 12.5
14-
run: sudo xcode-select -s /Applications/Xcode_12.5.app
13+
- name: Select Xcode 13.0
14+
run: sudo xcode-select -s /Applications/Xcode_13.0.app
1515
- name: Run Bluepill tests
1616
run: ./scripts/bluepill.sh instance_tests1
1717
- name: Capture xcresult files
@@ -29,8 +29,8 @@ jobs:
2929
steps:
3030
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
3131
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
32-
- name: Select Xcode 12.5
33-
run: sudo xcode-select -s /Applications/Xcode_12.5.app
32+
- name: Select Xcode 13.0
33+
run: sudo xcode-select -s /Applications/Xcode_13.0.app
3434
- name: Run Bluepill tests
3535
run: ./scripts/bluepill.sh instance_tests2
3636
- name: Capture xcresult files
@@ -48,8 +48,8 @@ jobs:
4848
steps:
4949
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
5050
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
51-
- name: Select Xcode 12.5
52-
run: sudo xcode-select -s /Applications/Xcode_12.5.app
51+
- name: Select Xcode 13.0
52+
run: sudo xcode-select -s /Applications/Xcode_13.0.app
5353
- name: Run Bluepill tests
5454
run: ./scripts/bluepill.sh runner_tests
5555
- name: Capture xcresult files

.github/workflows/master.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
steps:
1616
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
1717
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
18-
- name: Select Xcode 12.5
19-
run: sudo xcode-select -s /Applications/Xcode_12.5.app
18+
- name: Select Xcode 13.0
19+
run: sudo xcode-select -s /Applications/Xcode_13.0.app
2020
- name: Run Bluepill tests
2121
run: ./scripts/bluepill.sh instance_tests1
2222
- name: Capture xcresult files
@@ -34,8 +34,8 @@ jobs:
3434
steps:
3535
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
3636
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
37-
- name: Select Xcode 12.5
38-
run: sudo xcode-select -s /Applications/Xcode_12.5.app
37+
- name: Select Xcode 13.0
38+
run: sudo xcode-select -s /Applications/Xcode_13.0.app
3939
- name: Run Bluepill tests
4040
run: ./scripts/bluepill.sh instance_tests2
4141
- name: Capture xcresult files
@@ -53,8 +53,8 @@ jobs:
5353
steps:
5454
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
5555
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
56-
- name: Select Xcode 12.5
57-
run: sudo xcode-select -s /Applications/Xcode_12.5.app
56+
- name: Select Xcode 13.0
57+
run: sudo xcode-select -s /Applications/Xcode_13.0.app
5858
- name: Run Bluepill tests
5959
run: ./scripts/bluepill.sh runner_tests
6060
- name: Capture xcresult files

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
steps:
1414
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
1515
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
16-
- name: Select Xcode 12.5
17-
run: sudo xcode-select -s /Applications/Xcode_12.5.app
16+
- name: Select Xcode 13.0
17+
run: sudo xcode-select -s /Applications/Xcode_13.0.app
1818
- name: Run Bluepill tests
1919
run: ./scripts/bluepill.sh instance_tests1
2020
- name: Capture xcresult files
@@ -32,8 +32,8 @@ jobs:
3232
steps:
3333
# actions/checkout@v2 but we use the SHA1 because tags can be re-written in git
3434
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
35-
- name: Select Xcode 12.5
36-
run: sudo xcode-select -s /Applications/Xcode_12.5.app
35+
- name: Select Xcode 13.0
36+
run: sudo xcode-select -s /Applications/Xcode_13.0.app
3737
- name: Run Bluepill tests
3838
run: ./scripts/bluepill.sh instance_tests2
3939
- name: Capture xcresult files
@@ -54,8 +54,8 @@ jobs:
5454
- name: Report event trigger data
5555
run: |
5656
echo "Event ${{ github.event_name }}, ref: ${{ github.ref }}"
57-
- name: Select Xcode 12.5
58-
run: sudo xcode-select -s /Applications/Xcode_12.5.app
57+
- name: Select Xcode 13.0
58+
run: sudo xcode-select -s /Applications/Xcode_13.0.app
5959
- name: Run Bluepill tests
6060
run: ./scripts/bluepill.sh runner_tests
6161
- name: Capture xcresult files

Configurations/common.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ DEPLOYMENT_LOCATION = YES
1515
// Used by bluepill and bp to search for frameworks.
1616
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"
1717

18-
OTHER_LDFLAGS = -weak_framework DVTFoundation -weak_framework DVTiPhoneSimulatorRemoteClient -weak_framework CoreSimulator -weak_framework XCTest -weak_framework DTXConnectionServices -weak_framework SimulatorKit
18+
OTHER_LDFLAGS = -weak_framework DVTFoundation -weak_framework CoreSimulator -weak_framework XCTest -weak_framework DTXConnectionServices -weak_framework SimulatorKit

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ The exit code of Bluepill uses bit indicators which could represent multiple exi
104104

105105
## Requirements
106106

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

109109
* [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)
110110
* [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)
111-
* [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)
111+
* [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)
112112

113113

114114
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.

bp/bp.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,8 +1184,6 @@
11841184
"-weak_framework",
11851185
DVTFoundation,
11861186
"-weak_framework",
1187-
DVTiPhoneSimulatorRemoteClient,
1188-
"-weak_framework",
11891187
CoreSimulator,
11901188
"-weak_framework",
11911189
XCTest,
@@ -1219,8 +1217,6 @@
12191217
"-weak_framework",
12201218
DVTFoundation,
12211219
"-weak_framework",
1222-
DVTiPhoneSimulatorRemoteClient,
1223-
"-weak_framework",
12241220
CoreSimulator,
12251221
"-weak_framework",
12261222
XCTest,

bp/src/BPConstants.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#import <Foundation/Foundation.h>
1111

1212
#pragma mark - Version Constants
13-
#define BP_DEFAULT_XCODE_VERSION "12.5"
14-
#define BP_DEFAULT_RUNTIME "iOS 14.5"
15-
#define BP_DEFAULT_BASE_SDK "14.5"
13+
#define BP_DEFAULT_XCODE_VERSION "13.0"
14+
#define BP_DEFAULT_RUNTIME "iOS 15.0"
15+
#define BP_DEFAULT_BASE_SDK "15.0"
1616

1717
#define BP_DEFAULT_DEVICE_TYPE "iPhone 8"
1818

bp/src/BPUtils.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ + (void)saveDebuggingDiagnostics:(NSString *)outputDirectory {
288288
if (outputDirectory == nil || !([fm fileExistsAtPath:outputDirectory isDirectory:&isDir] && isDir)) {
289289
return;
290290
}
291-
NSString *cmd = [NSString stringWithFormat:@"xcrun simctl diagnose -l -b --output='%@/diagnostics' --data-container", outputDirectory];
291+
NSString *cmd = [NSString stringWithFormat:@"xcrun simctl diagnose -l -b --output='%@/diagnostics'", outputDirectory];
292292
[BPUtils runShell:cmd];
293293
cmd = [NSString stringWithFormat:@"ps axuw > '%@'/ps-axuw.log", outputDirectory];
294294
[BPUtils runShell:cmd];

bp/tests/BPReportTests.m

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,12 @@ - (void)testReportSuccessOnTestFailedAndPassOnRetry {
408408
XCTAssertTrue(exitCode == BPExitStatusAllTestsPassed);
409409
}
410410

411-
- (void)testReportWithFailingTestsSetAndDiagnostics {
411+
- (void)testReportWithFailingTestsSet {
412412
NSString *tempDir = NSTemporaryDirectory();
413413
NSError *error;
414414
NSString *outputDir = [BPUtils mkdtemp:[NSString stringWithFormat:@"%@/FailingTestsSetTempDir", tempDir] withError:&error];
415-
// NSLog(@"output directory is %@", outputDir);
415+
NSLog(@"output directory is %@", outputDir);
416416
self.config.outputDirectory = outputDir;
417-
self.config.saveDiagnosticsOnError = YES;
418417
self.config.testCasesToSkip = @[@"BPAppNegativeTests/testBPDoesNotHangWithBigOutput"];
419418
BPExitStatus exitCode = [[[Bluepill alloc ] initWithConfiguration:self.config] run];
420419
// Make sure all tests started on the first run
@@ -433,6 +432,27 @@ - (void)testReportWithFailingTestsSetAndDiagnostics {
433432
NSLog(@"Junit report: %@", junitReportPath);
434433
NSString *expectedFilePath = [[[NSBundle bundleForClass:[self class]] resourcePath] stringByAppendingPathComponent:@"BPAppNegativeTests-results.xml"];
435434
[self assertGotReport:junitReportPath isEqualToWantReport:expectedFilePath];
435+
XCTAssert(exitCode == BPExitStatusTestsFailed);
436+
}
437+
438+
/**
439+
Execution plan: TIMEOUT, CRASH (not retried)
440+
*/
441+
- (void)testReportFailureOnTimeoutCrashAndPassWithDiagnostics {
442+
self.config.stuckTimeout = @6;
443+
self.config.testing_ExecutionPlan = @"TIMEOUT CRASH";
444+
self.config.errorRetriesCount = @4;
445+
self.config.onlyRetryFailed = TRUE;
446+
NSString *tempDir = NSTemporaryDirectory();
447+
NSError *error;
448+
NSString *outputDir = [BPUtils mkdtemp:[NSString stringWithFormat:@"%@/FailingTestsSetTempDir", tempDir] withError:&error];
449+
NSLog(@"output directory is %@", outputDir);
450+
self.config.outputDirectory = outputDir;
451+
self.config.saveDiagnosticsOnError = YES;
452+
NSString *testBundlePath = [BPTestHelper sampleAppHangingTestsBundlePath];
453+
self.config.testBundlePath = testBundlePath;
454+
455+
BPExitStatus exitCode = [[[Bluepill alloc ] initWithConfiguration:self.config] run];
436456
NSFileManager *fm = [NSFileManager defaultManager];
437457
[BPUtils runShell:[NSString stringWithFormat:@"find %@", outputDir]];
438458
BOOL diagFileFound = [fm fileExistsAtPath:[NSString stringWithFormat:@"%@/diagnostics.tar.gz", outputDir]];
@@ -441,7 +461,7 @@ - (void)testReportWithFailingTestsSetAndDiagnostics {
441461
XCTAssert(psFileFound);
442462
BOOL dfFileFound = [fm fileExistsAtPath:[NSString stringWithFormat:@"%@/df-h.log", outputDir]];
443463
XCTAssert(dfFileFound);
444-
XCTAssert(exitCode == BPExitStatusTestsFailed);
464+
XCTAssertTrue(exitCode == BPExitStatusAppCrashed);
445465
}
446466

447467
#pragma mark - Test helpers
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<testsuites name="Selected tests" tests="1" failures="0" errors="0">
33
<testsuite tests="1" failures="0" errors="0" name="BPSampleAppFatalErrorTests.xctest">
4+
<testsuite tests="0" failures="0" errors="0" name="BPSampleAppFatalErrorTests"></testsuite>
45
<testsuite tests="1" failures="0" errors="0" name="BPSampleAppSwiftFatalErrorTests">
56
<testcase classname="BPSampleAppSwiftFatalErrorTests" name="testZPass()" time="0.002000">
67
</testcase>
78
</testsuite>
89
</testsuite>
910
</testsuites>
10-
11-

0 commit comments

Comments
 (0)