Skip to content

Configure CI via Buildkite#6

Merged
mokagio merged 6 commits intotrunkfrom
add/buildkite
Aug 26, 2021
Merged

Configure CI via Buildkite#6
mokagio merged 6 commits intotrunkfrom
add/buildkite

Conversation

@mokagio
Copy link
Contributor

@mokagio mokagio commented Aug 25, 2021

Integrates Buildkite to run the UI tests against iPhone 12 and latest iPad Pro.
We may add more Simulator targets in the future, e.g. if we discover fiddly methods that behave differently across Simulator.

To test, verify that CI run and passed.

@mokagio mokagio marked this pull request as ready for review August 25, 2021 01:57
@mokagio mokagio requested a review from pachlava August 25, 2021 02:06
@mokagio mokagio enabled auto-merge August 25, 2021 02:06
xcodebuild clean test \
-project 'ScreenObject.xcodeproj' \
-scheme 'ScreenObject' \
-destination "platform=iOS Simulator,name=$SIMULATOR_NAME,OS=14.5"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to:

  1. Keep this simple and don't integrate Fastlane just to run the tests, nor xcpretty or xcbeautify to format the output. All of those options would require extra dependency and CI setup that doesn't seem granted at this time
  2. Hardcode the iOS version here, rather than pass it to the script, so we have a single source of truth. This makes the syntax a bit less clear in the pipeline, though. Given the scope of this project, I think we can deal with it for the moment. I can also see a future in which we might want to run tests against multiple iOS version, if we get to it, we can start passing the value in the same way as we do with $SIMULATOR_NAME.

Copy link

@AliSoftware AliSoftware Aug 26, 2021

Choose a reason for hiding this comment

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

Comment on lines +1 to +4
env:
IMAGE_ID: xcode-12.5.1
agents:
queue: 'mac'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jkmassel @AliSoftware TIL that Buildkite offers a native way to specify default env and agents. I think we should adopt this approach in our other pipelines instead of the custom anchor for the env value.

I haven't tested this, but I expect that if we define a default env with a FOO variable and then define a step-specific env with a BAR variable, the step will have access to both FOO and BAR.

Choose a reason for hiding this comment

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

I like the pipeline level default and agree it makes sense to use it.

But unlike you my guess would be that any step-specific env would completely override the default. Otherwise there wouldn't be a way to undefine FOO in some steps… so in any case definitively worth checking the behavior in such a case.

Choose a reason for hiding this comment

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

@mokagio Huh, actually this might not behave like either of us expect, as according to the BuildKite documentation, the env set at the top level… always takes precedence over the ones set on each step?!

Top level pipeline environment variables will override what is set in the env attribute of an individual step.

Source: BuildKite docs

Which is a strange choice from them imho, and iiuc means that we wouldn't be able to provide e.g. a different IMAGE_ID just for a specific step while using the top-level-defined one as a default, because the top-level one would always override them all… 😒

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 I'm guessing that's a typo in the docs. I run a test and the results is inline with my expectation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opened a PR in their docs to suggest an update.

This option works fine for this pipeline, but we should wait to see what Buildkite replies in terms of what the expected behavior is before considering updating our other pipelines.

Copy link
Contributor

@pachlava pachlava left a comment

Choose a reason for hiding this comment

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

Same as my comment for Automattic/XCUITestHelpers/pull/4 (minus the error part, which did not appear here). Thank you! :shipit:

@mokagio mokagio merged commit 7f31908 into trunk Aug 26, 2021
@mokagio mokagio deleted the add/buildkite branch August 26, 2021 13:51
@AliSoftware
Copy link

AliSoftware commented Aug 26, 2021

Oh shoot my bad I should have disabled the auto-merge after commenting this… 😓
I didn't think that comment warranted a "Request Changes" because I didn't consider it a hard blocker, but now the PR was auto-merged without giving @mokagio a chance to consider updating the comment/wording before merge 🙃

Gio, feel free to open a subsequent PR if you think my wording nitpick/suggestion is worth it 🙂

@pachlava
Copy link
Contributor

My bad too... Didn't realize my approval would trigger auto-merge, sorry Gio!

@mokagio
Copy link
Contributor Author

mokagio commented Aug 31, 2021

No worries @AliSoftware @pachlava 👍 👌 Thank for noticing and caring.

I'll followup on the wording next week, as I'm currently on support rotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants