Skip to content

Fix false positive Keystone and WordPressData tests in CI #24630

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

Merged
merged 5 commits into from
Jul 3, 2025
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
17 changes: 17 additions & 0 deletions .buildkite/commands/run-unit-tests-for-scheme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -euo pipefail
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth extracting that on its dedicated set -euo pipefail line just to be sure.

This is because I think that if the command in the pipeline is a single string to a script with no parameter—and not a multiline string invoking multiple commands or a string invoking a command with parameters—then Buildkite might source that script (which makes the shebang ignored) instead of calling it as a command.

This is not the case currently because while the command: is now single line, it still passes a parameter to the script, so Buildkite with still call it not source it.

But in case in the future we end up not needing that parameter anymore and remove it and this ends up having the obscure side-effect of having the script sourced … better safe than sorry?


SCHEME="${1:?Usage $0 SCHEME}"
DEVICE="iPhone 16"
OS_VERSION="18.4"

if "$(dirname "${BASH_SOURCE[0]}")/should-skip-job.sh" --job-type validation; then
exit 0
fi

$(dirname "${BASH_SOURCE[0]}")/shared-set-up.sh

xcodebuild \
-scheme "${SCHEME}" \
-destination "platform=iOS Simulator,OS=${OS_VERSION},name=${DEVICE}" \
test \
| xcbeautify
32 changes: 10 additions & 22 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
---

# Most of the steps need to run on a macOS agent, so let's define it as a root property.
agents:
queue: mac
Expand Down Expand Up @@ -111,35 +114,20 @@ steps:
- github_commit_status:
context: "Reader Unit Tests"
- label: "🔬 Keystone Unit Tests"
command: |
if .buildkite/commands/should-skip-job.sh --job-type validation; then
exit 0
fi

.buildkite/commands/shared-set-up.sh
xcodebuild \
-scheme Keystone \
-destination 'platform=iOS Simulator,OS=18.2,name=iPhone 16' \
test \
| xcbeautify
command: .buildkite/commands/run-unit-tests-for-scheme.sh Keystone
# Disabled till https://github.com/wordpress-mobile/WordPress-iOS/pull/24537 is completed
#
# The boolean value has to be a string explicitly.
# See validation error against schema.
if: "false"
Copy link
Contributor Author

@mokagio mokagio Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice the step for Keystone Tsets is no longer there

image

plugins: [$CI_TOOLKIT_PLUGIN]
artifact_paths:
- "build/results/*"
notify:
- github_commit_status:
context: "Unit Tests Keystone"
- label: "🔬 WordPressData Unit Tests"
command: |
if .buildkite/commands/should-skip-job.sh --job-type validation; then
exit 0
fi

.buildkite/commands/shared-set-up.sh
xcodebuild \
-scheme WordPressData \
-destination 'platform=iOS Simulator,OS=18.2,name=iPhone 16' \
test \
| xcbeautify
command: .buildkite/commands/run-unit-tests-for-scheme.sh WordPressData
plugins: [$CI_TOOLKIT_PLUGIN]
artifact_paths:
- "build/results/*"
Expand Down