Skip to content

Commit b1083b4

Browse files
authored
Fix false positive Keystone and WordPressData tests in CI (#24630)
* Add `pipefail` to inline commands to run tests in CI * Run Keystone and WordPressData unit tests in CI on iOS 18.4 The only iOS version available out of the box with the 16.3 stack. * DRY command to run unit tests focused to a scheme in CI * Disable Keystone tests in CI * Add schema to Buildkite pipeline and address `if: false` violation
1 parent 9e1f1e0 commit b1083b4

File tree

2 files changed

+27
-22
lines changed

2 files changed

+27
-22
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash -euo pipefail
2+
3+
SCHEME="${1:?Usage $0 SCHEME}"
4+
DEVICE="iPhone 16"
5+
OS_VERSION="18.4"
6+
7+
if "$(dirname "${BASH_SOURCE[0]}")/should-skip-job.sh" --job-type validation; then
8+
exit 0
9+
fi
10+
11+
$(dirname "${BASH_SOURCE[0]}")/shared-set-up.sh
12+
13+
xcodebuild \
14+
-scheme "${SCHEME}" \
15+
-destination "platform=iOS Simulator,OS=${OS_VERSION},name=${DEVICE}" \
16+
test \
17+
| xcbeautify

.buildkite/pipeline.yml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
2+
---
3+
14
# Most of the steps need to run on a macOS agent, so let's define it as a root property.
25
agents:
36
queue: mac
@@ -111,35 +114,20 @@ steps:
111114
- github_commit_status:
112115
context: "Reader Unit Tests"
113116
- label: "🔬 Keystone Unit Tests"
114-
command: |
115-
if .buildkite/commands/should-skip-job.sh --job-type validation; then
116-
exit 0
117-
fi
118-
119-
.buildkite/commands/shared-set-up.sh
120-
xcodebuild \
121-
-scheme Keystone \
122-
-destination 'platform=iOS Simulator,OS=18.2,name=iPhone 16' \
123-
test \
124-
| xcbeautify
117+
command: .buildkite/commands/run-unit-tests-for-scheme.sh Keystone
118+
# Disabled till https://github.com/wordpress-mobile/WordPress-iOS/pull/24537 is completed
119+
#
120+
# The boolean value has to be a string explicitly.
121+
# See validation error against schema.
122+
if: "false"
125123
plugins: [$CI_TOOLKIT_PLUGIN]
126124
artifact_paths:
127125
- "build/results/*"
128126
notify:
129127
- github_commit_status:
130128
context: "Unit Tests Keystone"
131129
- label: "🔬 WordPressData Unit Tests"
132-
command: |
133-
if .buildkite/commands/should-skip-job.sh --job-type validation; then
134-
exit 0
135-
fi
136-
137-
.buildkite/commands/shared-set-up.sh
138-
xcodebuild \
139-
-scheme WordPressData \
140-
-destination 'platform=iOS Simulator,OS=18.2,name=iPhone 16' \
141-
test \
142-
| xcbeautify
130+
command: .buildkite/commands/run-unit-tests-for-scheme.sh WordPressData
143131
plugins: [$CI_TOOLKIT_PLUGIN]
144132
artifact_paths:
145133
- "build/results/*"

0 commit comments

Comments
 (0)