Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit f25ed67

Browse files
authored
Integrate Buildkite Test Analytics (#392)
2 parents 6fb44be + 25751cb commit f25ed67

File tree

8 files changed

+138
-11
lines changed

8 files changed

+138
-11
lines changed

.buildkite/pipeline.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Nodes with values to reuse in the pipeline.
22
common_params:
33
plugins: &common_plugins
4-
- &bash_cache automattic/bash-cache#v1.5.0: ~
4+
- &bash_cache automattic/bash-cache#2.7.0: ~
55
# Common environment values to use with the `env` key.
66
env: &common_env
7-
IMAGE_ID: xcode-12.5.1
7+
IMAGE_ID: xcode-13.4.1
88

99
# This is the default pipeline – it will build and test the app
1010
steps:
@@ -13,7 +13,11 @@ steps:
1313
################
1414
- label: "🧪 Build and Test"
1515
key: "test"
16-
command: "build_and_test_pod"
16+
command: |
17+
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
18+
gem install bundler
19+
20+
build_and_test_pod
1721
env: *common_env
1822
plugins: *common_plugins
1923
artifact_paths: ".build/logs/*.log"
@@ -23,7 +27,11 @@ steps:
2327
#################
2428
- label: "🔬 Validate Podspec"
2529
key: "validate"
26-
command: "validate_podspec"
30+
command: |
31+
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
32+
gem install bundler
33+
34+
validate_podspec
2735
env: *common_env
2836
plugins: *common_plugins
2937
artifact_paths: ".build/logs/*.log"
@@ -33,7 +41,11 @@ steps:
3341
#################
3442
- label: "🧹 Lint"
3543
key: "lint"
36-
command: "lint_pod"
44+
command: |
45+
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
46+
gem install bundler
47+
48+
lint_pod
3749
env: *common_env
3850
plugins: *common_plugins
3951

.buildkite/publish-pod.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ PODSPEC_PATH="WPMediaPicker.podspec"
44
SLACK_WEBHOOK=$PODS_SLACK_WEBHOOK
55

66
echo "--- :rubygems: Setting up Gems"
7+
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
8+
gem install bundler
9+
710
install_gems
811

912
echo "--- :cocoapods: Publishing Pod to CocoaPods CDN"
1013
publish_pod $PODSPEC_PATH
1114

1215
echo "--- :slack: Notifying Slack"
13-
slack_notify_pod_published $PODSPEC_PATH $SLACK_WEBHOOK
16+
slack_notify_pod_published $PODSPEC_PATH "$SLACK_WEBHOOK"

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.4
1+
2.7.4

Example/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- WPMediaPicker (1.8.0-beta.1)
2+
- WPMediaPicker (1.8.4)
33

44
DEPENDENCIES:
55
- WPMediaPicker (from `../`)
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
99
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
WPMediaPicker: b71345bed88eb1b9ad6313e3410795e0f1182f47
12+
WPMediaPicker: 9533160e5587939876aeeb1461a441a4e5dc4c4d
1313

1414
PODFILE CHECKSUM: 31590cb12765a73c9da27d6ea5b8b127c095d71d
1515

Example/Tests/UnitTests.xctestplan

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"configurations" : [
3+
{
4+
"id" : "0B1AE21B-1942-457C-8E85-D1D9F3281758",
5+
"name" : "Configuration 1",
6+
"options" : {
7+
8+
}
9+
}
10+
],
11+
"defaultOptions" : {
12+
"environmentVariableEntries" : [
13+
{
14+
"key" : "BUILDKITE_ANALYTICS_TOKEN",
15+
"value" : "$(BUILDKITE_ANALYTICS_TOKEN)"
16+
},
17+
{
18+
"key" : "BUILDKITE_BRANCH",
19+
"value" : "$(BUILDKITE_BRANCH)"
20+
},
21+
{
22+
"key" : "BUILDKITE_BUILD_ID",
23+
"value" : "$(BUILDKITE_BUILD_ID)"
24+
},
25+
{
26+
"key" : "BUILDKITE_BUILD_NUMBER",
27+
"value" : "$(BUILDKITE_BUILD_NUMBER)"
28+
},
29+
{
30+
"key" : "BUILDKITE_BUILD_URL",
31+
"value" : "$(BUILDKITE_BUILD_URL)"
32+
},
33+
{
34+
"key" : "BUILDKITE_COMMIT",
35+
"value" : "$(BUILDKITE_COMMIT)"
36+
},
37+
{
38+
"key" : "BUILDKITE_JOB_ID",
39+
"value" : "$(BUILDKITE_JOB_ID)"
40+
},
41+
{
42+
"key" : "BUILDKITE_MESSAGE",
43+
"value" : "$(BUILDKITE_MESSAGE)"
44+
}
45+
],
46+
"targetForVariableExpansion" : {
47+
"containerPath" : "container:WPMediaPicker.xcodeproj",
48+
"identifier" : "6003F589195388D20070C39A",
49+
"name" : "WPMediaPicker"
50+
},
51+
"testTimeoutsEnabled" : true
52+
},
53+
"testTargets" : [
54+
{
55+
"target" : {
56+
"containerPath" : "container:WPMediaPicker.xcodeproj",
57+
"identifier" : "6003F5AD195388D20070C39A",
58+
"name" : "Tests"
59+
}
60+
}
61+
],
62+
"version" : 1
63+
}

Example/WPMediaPicker.xcodeproj/project.pbxproj

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 52;
77
objects = {
88

99
/* Begin PBXBuildFile section */
1010
173B215327873F2E00D4DD6B /* SampleCustomHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 173B215227873F2E00D4DD6B /* SampleCustomHeaderView.m */; };
1111
17475FB81FB46DED00252689 /* SampleCellOverlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 17475FB71FB46DED00252689 /* SampleCellOverlayView.m */; };
1212
17F64FE01E6DDC74006C5A2B /* CustomPreviewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 17F64FDF1E6DDC74006C5A2B /* CustomPreviewViewController.m */; };
13+
3F3E104428A0BA870041FA5A /* BuildkiteTestCollector in Frameworks */ = {isa = PBXBuildFile; productRef = 3F3E104328A0BA870041FA5A /* BuildkiteTestCollector */; };
1314
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
1415
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
1516
6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
@@ -49,6 +50,7 @@
4950
17475FB71FB46DED00252689 /* SampleCellOverlayView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SampleCellOverlayView.m; sourceTree = "<group>"; };
5051
17F64FDE1E6DDC74006C5A2B /* CustomPreviewViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomPreviewViewController.h; sourceTree = "<group>"; };
5152
17F64FDF1E6DDC74006C5A2B /* CustomPreviewViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomPreviewViewController.m; sourceTree = "<group>"; };
53+
3F3E104528A0BAAE0041FA5A /* UnitTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UnitTests.xctestplan; sourceTree = "<group>"; };
5254
5709B45B57F590232B3E5DA7 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
5355
6003F58A195388D20070C39A /* WPMediaPicker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WPMediaPicker.app; sourceTree = BUILT_PRODUCTS_DIR; };
5456
6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -104,6 +106,7 @@
104106
buildActionMask = 2147483647;
105107
files = (
106108
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
109+
3F3E104428A0BA870041FA5A /* BuildkiteTestCollector in Frameworks */,
107110
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
108111
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
109112
AE22BBE03B862A6657E6B66E /* libPods-Tests.a in Frameworks */,
@@ -189,6 +192,7 @@
189192
children = (
190193
6003F5BB195388D20070C39A /* WPDateTimeHelpersTests.m */,
191194
6003F5B6195388D20070C39A /* Supporting Files */,
195+
3F3E104528A0BAAE0041FA5A /* UnitTests.xctestplan */,
192196
);
193197
path = Tests;
194198
sourceTree = "<group>";
@@ -263,6 +267,9 @@
263267
6003F5B4195388D20070C39A /* PBXTargetDependency */,
264268
);
265269
name = Tests;
270+
packageProductDependencies = (
271+
3F3E104328A0BA870041FA5A /* BuildkiteTestCollector */,
272+
);
266273
productName = WPMediaPickerTests;
267274
productReference = 6003F5AE195388D20070C39A /* Tests.xctest */;
268275
productType = "com.apple.product-type.bundle.unit-test";
@@ -295,6 +302,9 @@
295302
Base,
296303
);
297304
mainGroup = 6003F581195388D10070C39A;
305+
packageReferences = (
306+
3F3E104228A0BA870041FA5A /* XCRemoteSwiftPackageReference "test-collector-swift" */,
307+
);
298308
productRefGroup = 6003F58B195388D20070C39A /* Products */;
299309
projectDirPath = "";
300310
projectRoot = "";
@@ -661,6 +671,25 @@
661671
defaultConfigurationName = Release;
662672
};
663673
/* End XCConfigurationList section */
674+
675+
/* Begin XCRemoteSwiftPackageReference section */
676+
3F3E104228A0BA870041FA5A /* XCRemoteSwiftPackageReference "test-collector-swift" */ = {
677+
isa = XCRemoteSwiftPackageReference;
678+
repositoryURL = "https://github.com/buildkite/test-collector-swift";
679+
requirement = {
680+
kind = upToNextMajorVersion;
681+
minimumVersion = 0.3.0;
682+
};
683+
};
684+
/* End XCRemoteSwiftPackageReference section */
685+
686+
/* Begin XCSwiftPackageProductDependency section */
687+
3F3E104328A0BA870041FA5A /* BuildkiteTestCollector */ = {
688+
isa = XCSwiftPackageProductDependency;
689+
package = 3F3E104228A0BA870041FA5A /* XCRemoteSwiftPackageReference "test-collector-swift" */;
690+
productName = BuildkiteTestCollector;
691+
};
692+
/* End XCSwiftPackageProductDependency section */
664693
};
665694
rootObject = 6003F582195388D10070C39A /* Project object */;
666695
}

Example/WPMediaPicker.xcodeproj/xcshareddata/xcschemes/WPMediaPicker-Example.xcscheme

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
33
LastUpgradeVersion = "1240"
4-
version = "1.3">
4+
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
@@ -36,6 +36,12 @@
3636
ReferencedContainer = "container:WPMediaPicker.xcodeproj">
3737
</BuildableReference>
3838
</MacroExpansion>
39+
<TestPlans>
40+
<TestPlanReference
41+
reference = "container:Tests/UnitTests.xctestplan"
42+
default = "YES">
43+
</TestPlanReference>
44+
</TestPlans>
3945
<Testables>
4046
<TestableReference
4147
skipped = "NO">

Example/WPMediaPicker.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)