Skip to content
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
7 changes: 5 additions & 2 deletions .buildkite/shared-pipeline-vars
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
# This file is `source`'d before calling `buildkite-agent pipeline upload`, and can be used
# to set up some variables that will be interpolated in the `.yml` pipeline before uploading it.

export IMAGE_ID="xcode-16.2-macos-14.7.1-v1"
# The ~> modifier is not currently used, but we check for it just in case
XCODE_VERSION=$(sed -E 's/^~> ?//' .xcode-version)

export CI_TOOLKIT="automattic/a8c-ci-toolkit#3.9.1"
export IMAGE_ID="xcode-$XCODE_VERSION"
Comment on lines +6 to +9

export CI_TOOLKIT="automattic/a8c-ci-toolkit#6.1.1"

export SWIFTFORMAT_VERSION=$( awk '/^--minversion/ { print $2 }' .swiftformat )
1 change: 1 addition & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: "true"
4 changes: 2 additions & 2 deletions .github/workflows/docc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:
# Must be set to this for deploying to GitHub Pages
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: macos-15
runs-on: macos-26
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Switch Xcode 🔄
run: sudo xcode-select --switch /Applications/Xcode_16.2.app
run: sudo xcode-select --switch /Applications/Xcode_26.6.app

- name: Prepare Site
run: |
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.2
3.4.9
1 change: 1 addition & 0 deletions .xcode-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
26.6
5 changes: 1 addition & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ GEM
nokogiri (1.19.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.19.4-arm64-darwin)
racc (~> 1.4)
octokit (6.1.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
Expand Down Expand Up @@ -368,7 +366,6 @@ GEM
xcpretty (~> 0.2, >= 0.0.7)

PLATFORMS
arm64-darwin-23
ruby

DEPENDENCIES
Expand All @@ -379,4 +376,4 @@ DEPENDENCIES
rubocop (~> 1.88)

BUNDLED WITH
2.6.8
4.0.16
30 changes: 15 additions & 15 deletions Tests/GravatarUITests/LargeProfileSummaryViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
for interfaceStyle in UIUserInterfaceStyle.allCases {
let (containerView, _) = createViews(model: TestProfileCardModel.summaryCard())
containerView.overrideUserInterfaceStyle = interfaceStyle
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}
}

Expand All @@ -27,7 +27,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
for interfaceStyle in UIUserInterfaceStyle.allCases {
let (containerView, _) = createViews(model: nil)
containerView.overrideUserInterfaceStyle = interfaceStyle
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}
}

Expand All @@ -37,7 +37,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
let (containerView, cardView) = createViews(model: TestProfileCardModel.summaryCard())
containerView.overrideUserInterfaceStyle = interfaceStyle
cardView.update(with: nil) // clear data and show placeholders
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}

@MainActor
Expand All @@ -47,7 +47,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
containerView.overrideUserInterfaceStyle = interfaceStyle
cardView.update(with: nil) // clear data and show placeholders
cardView.update(with: TestProfileCardModel.summaryCard()) // set data and hide placeholders
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}

@MainActor
Expand All @@ -56,7 +56,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
let (containerView, cardView) = createViews(model: TestProfileCardModel.summaryCard(), paletteType: .custom(Palette.testPalette))
containerView.overrideUserInterfaceStyle = interfaceStyle
cardView.update(with: nil) // clear data and show placeholders
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand All @@ -66,7 +66,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
containerView.overrideUserInterfaceStyle = interfaceStyle
cardView.update(with: nil) // clear data and show placeholders
cardView.update(with: TestProfileCardModel.summaryCard()) // set data and hide placeholders
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand All @@ -75,7 +75,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
let (containerView, cardView) = createViews(model: nil)
containerView.overrideUserInterfaceStyle = interfaceStyle
cardView.placeholderColorPolicy = .custom(PlaceholderColors(backgroundColor: .purple, loadingAnimationColors: [.green, .blue]))
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}

@MainActor
Expand All @@ -85,7 +85,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
containerView.overrideUserInterfaceStyle = interfaceStyle
cardView.isLoading = true
cardView.isLoading = false
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}

@MainActor
Expand All @@ -96,7 +96,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
cardView.isLoading = true
cardView.update(with: TestProfileCardModel.summaryCard())
cardView.isLoading = false
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}

@MainActor
Expand All @@ -105,15 +105,15 @@ final class LargeProfileSummaryViewTests: XCTestCase {
let (containerView, profileView) = createViews(model: nil)
profileView.updateWithClaimProfilePrompt()
containerView.overrideUserInterfaceStyle = interfaceStyle
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}
}

@MainActor
func testLargeProfileSummaryViewEmptyStateCustomPalette() throws {
let (containerView, cardView) = createViews(model: nil, paletteType: .custom(Palette.testPalette))
cardView.updateWithClaimProfilePrompt()
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand All @@ -123,7 +123,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
paletteType: .light,
avatarType: .imageView(TestAvatarImageView(frame: .zero))
)
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand All @@ -135,7 +135,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
avatarType: .imageView(avatarView, skipStyling: true)
)
avatarView.applyStyle()
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand All @@ -146,7 +146,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
paletteType: .light,
avatarType: .imageViewWrapper(avatarView)
)
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand All @@ -157,7 +157,7 @@ final class LargeProfileSummaryViewTests: XCTestCase {
paletteType: .light,
avatarType: .custom(avatarView)
)
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand Down
30 changes: 15 additions & 15 deletions Tests/GravatarUITests/LargeProfileViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ final class LargeProfileViewTests: XCTestCase {
for paletteType in palettesToTest {
let (cardView, containerView) = createViews(paletteType: paletteType)
cardView.update(with: TestProfileCardModel.fullCard())
assertSnapshot(of: containerView, as: .image, named: "testLargeProfileView-\(paletteType.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "testLargeProfileView-\(paletteType.name)")
}
}

@MainActor
func testInitiallyEmptyLargeProfileView() throws {
for paletteType in palettesToTest {
let (_, containerView) = createViews(paletteType: paletteType)
assertSnapshot(of: containerView, as: .image, named: "\(paletteType.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(paletteType.name)")
}
}

Expand All @@ -39,7 +39,7 @@ final class LargeProfileViewTests: XCTestCase {
containerView.overrideUserInterfaceStyle = interfaceStyle
cardView.update(with: TestProfileCardModel.fullCard())
cardView.update(with: nil) // clear data and show placeholders
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}

@MainActor
Expand All @@ -50,7 +50,7 @@ final class LargeProfileViewTests: XCTestCase {
cardView.update(with: TestProfileCardModel.fullCard())
cardView.update(with: nil) // clear data and show placeholders
cardView.update(with: TestProfileCardModel.summaryCard()) // set data and hide placeholders
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}

@MainActor
Expand All @@ -60,7 +60,7 @@ final class LargeProfileViewTests: XCTestCase {
containerView.overrideUserInterfaceStyle = interfaceStyle
cardView.update(with: TestProfileCardModel.fullCard())
cardView.update(with: nil) // clear data and show placeholders
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand All @@ -71,7 +71,7 @@ final class LargeProfileViewTests: XCTestCase {
cardView.update(with: TestProfileCardModel.fullCard())
cardView.update(with: nil) // clear data and show placeholders
cardView.update(with: TestProfileCardModel.summaryCard()) // set data and hide placeholders
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand All @@ -80,7 +80,7 @@ final class LargeProfileViewTests: XCTestCase {
let (cardView, containerView) = createViews(paletteType: .light)
containerView.overrideUserInterfaceStyle = interfaceStyle
cardView.placeholderColorPolicy = .custom(PlaceholderColors(backgroundColor: .purple, loadingAnimationColors: [.green, .blue]))
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}

@MainActor
Expand All @@ -90,7 +90,7 @@ final class LargeProfileViewTests: XCTestCase {
containerView.overrideUserInterfaceStyle = interfaceStyle
cardView.isLoading = true
cardView.isLoading = false
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}

@MainActor
Expand All @@ -101,7 +101,7 @@ final class LargeProfileViewTests: XCTestCase {
cardView.isLoading = true
cardView.update(with: TestProfileCardModel.fullCard())
cardView.isLoading = false
assertSnapshot(of: containerView, as: .image, named: "\(interfaceStyle.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "\(interfaceStyle.name)")
}

@MainActor
Expand All @@ -111,15 +111,15 @@ final class LargeProfileViewTests: XCTestCase {
cardView.updateWithClaimProfilePrompt()
containerView.backgroundColor = .systemBackground
containerView.overrideUserInterfaceStyle = paletteType.palette.preferredUserInterfaceStyle
assertSnapshot(of: containerView, as: .image, named: "testLargeProfileView-\(paletteType.name)")
assertSnapshot(of: containerView, as: .imageWithHostTolerance(), named: "testLargeProfileView-\(paletteType.name)")
}
}

@MainActor
func testLargeProfileViewEmptyStateCustomPalette() throws {
let (cardView, containerView) = createViews(paletteType: .custom(Palette.testPalette))
cardView.updateWithClaimProfilePrompt()
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand All @@ -129,7 +129,7 @@ final class LargeProfileViewTests: XCTestCase {
avatarType: .imageView(TestAvatarImageView(frame: .zero))
)
cardView.update(with: TestProfileCardModel.fullCard())
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand All @@ -141,7 +141,7 @@ final class LargeProfileViewTests: XCTestCase {
)
avatarView.applyStyle()
cardView.update(with: TestProfileCardModel.fullCard())
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand All @@ -152,7 +152,7 @@ final class LargeProfileViewTests: XCTestCase {
avatarType: .imageViewWrapper(avatarView)
)
cardView.update(with: TestProfileCardModel.fullCard())
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand All @@ -163,7 +163,7 @@ final class LargeProfileViewTests: XCTestCase {
avatarType: .custom(avatarView)
)
cardView.update(with: TestProfileCardModel.fullCard())
assertSnapshot(of: containerView, as: .image)
assertSnapshot(of: containerView, as: .imageWithHostTolerance())
}

@MainActor
Expand Down
8 changes: 5 additions & 3 deletions Tests/GravatarUITests/PersonalInfoBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ final class PersonalInfoBuilderTests: XCTestCase {
.asPersonalInfo()
.content(TestPersonalInfo.fullInfo())
.palette(palette)
assertSnapshot(of: label, as: .image, named: "testPersonalInfoFull-\(palette.name)")
assertSnapshot(of: label, as: .imageWithHostTolerance(), named: "testPersonalInfoFull-\(palette.name)")
}
}

Expand All @@ -61,7 +61,7 @@ final class PersonalInfoBuilderTests: XCTestCase {
.init([.location]),
], separator: " - ")
.palette(palette)
assertSnapshot(of: label, as: .image, named: "testPersonalInfoFull-\(palette.name)")
assertSnapshot(of: label, as: .imageWithHostTolerance(), named: "testPersonalInfoFull-\(palette.name)")
}
}

Expand All @@ -72,7 +72,9 @@ final class PersonalInfoBuilderTests: XCTestCase {
.asPersonalInfo()
.content(TestPersonalInfo.fullInfo())
.palette(.light)
assertSnapshot(of: label, as: .image)
// The label wraps to a narrow frame, so the separator spacing that shifts between macOS builds accounts for
// 2.8% of the image here rather than the usual fraction of a percent.
assertSnapshot(of: label, as: .imageWithHostTolerance(precision: 0.96))
}

@MainActor
Expand Down
3 changes: 2 additions & 1 deletion Tests/GravatarUITests/ProfileConfigurationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ final class TestProfileConfiguration: XCTestCase {
config.avatarConfiguration.avatarLength = 80
view.configuration = config
let superView = view.wrapInSuperView(with: Constants.width)
assertSnapshot(of: superView, as: .image)
// Summary layout: the personal info line is a larger share of this frame than in the full profile views.
assertSnapshot(of: superView, as: .imageWithHostTolerance(precision: 0.96))
}
}
Loading