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
2 changes: 1 addition & 1 deletion .buildkite/shared-pipeline-vars
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# 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.

XCODE_VERSION="26.0"
XCODE_VERSION="26.1.1"
CI_TOOLKIT_PLUGIN_VERSION="3.7.1"
TEST_COLLECTOR_VERSION="v1.10.2"

Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ source 'https://rubygems.org'
gem 'fastlane', '~> 2.228'
gem 'fastlane-plugin-wpmreleasetoolkit', '~> 13.7'
gem 'fluent-tools', '~> 0.3'
gem "openssl", "~> 3.3.1"
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ swift-example-app-mac:

swift-example-app-ios:
xcrun simctl create "iPhone 17 Pro Test Device" "com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro"
bundle exec fastlane run run_tests project:native/swift/Example/Example.xcodeproj scheme:Example build_for_testing:true ensure_devices_found:true device:"iPhone 17 Pro Test Device (26.0)" xcargs:"-skipPackagePluginValidation"
bundle exec fastlane run run_tests project:native/swift/Example/Example.xcodeproj scheme:Example build_for_testing:true ensure_devices_found:true device:"iPhone 17 Pro Test Device (26.1)" xcargs:"-skipPackagePluginValidation"

test-swift:
$(MAKE) test-swift-$(uname)
Expand All @@ -176,13 +176,13 @@ test-swift-darwin: xcframework
test-swift-macOS: test-swift-darwin

test-swift-iOS: xcframework
scripts/xcodebuild-test.sh iOS-26-0
scripts/xcodebuild-test.sh iOS-26-1

test-swift-tvOS: xcframework
scripts/xcodebuild-test.sh tvOS-26-0
scripts/xcodebuild-test.sh tvOS-26-1

test-swift-watchOS: xcframework
scripts/xcodebuild-test.sh watchOS-26-0
scripts/xcodebuild-test.sh watchOS-26-1

test-rust-lib:
$(rust_docker_run) cargo test --lib -- --nocapture
Expand Down
9 changes: 8 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 6.1
// swift-tools-version: 6.2

import Foundation
import PackageDescription
Expand Down Expand Up @@ -87,6 +87,13 @@ var package = Package(
.target(name: "WordPressAPIInternal")
],
path: "native/swift/Tests/wordpress-api-cache"
),
.testTarget(
name: "WordPressApiCompatibilityTests",
dependencies: [
.target(name: "WordPressAPI"),
],
path: "native/swift/Tests/api-compatibility"
)
].addingIntegrationTests()
)
Expand Down
7 changes: 7 additions & 0 deletions native/swift/Tests/api-compatibility/AppNotifier.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import WordPressAPI

final class AppNotifier: WpAppNotifier {
func requestedWithInvalidAuthentication(requestUrl: String) async {
// Ignore this for tests
}
}
27 changes: 27 additions & 0 deletions native/swift/Tests/api-compatibility/wpcom/SupportTickets.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import Foundation
import Testing
import WordPressAPI

// This test ensures that existing code compiles – it's not meant to run anything
struct SupportTicketsCompatTests {

@Test func `test ticket creation params`() async throws {
Copy link
Contributor

Choose a reason for hiding this comment

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

I have no idea you can use test ticket creation params as a function name. But it looks a bit strange, maybe just use regular function name convention?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only for tests :)

It makes the test names easy to read faster than @Test("test ticket creation params") func testTicketCreationParams():

Screenshot 2025-11-19 at 4 14 47 PM

Do you still feel this way if this is only for use with Swift Testing?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, I don't really mind it. Seems like a neat trick.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note: this is pretty common in Kotlin :)

_ = CreateSupportTicketParams(
subject: "Hello World",
message: "Test Message",
application: "Test Suite",
wpcomSiteId: 1234,
tags: ["tag1", "tag2"],
encryptedLogIds: [UUID().uuidString]
)
}

@Test func `test ticket reply params`() async throws {
_ = AddMessageToSupportConversationParams(
message: "This is a reply",
attachments: [
"/path/to/file/on/disk"
]
)
}
}
2 changes: 1 addition & 1 deletion wordpress.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ RUN curl -s -o swiftly.tar.gz "https://download.swift.org/swiftly/linux/swiftly-
RUN apt-get update \
&& apt-get -y -qq install libicu-dev libcurl4-openssl-dev libedit-dev libsqlite3-dev \
libncurses-dev libpython3-dev libxml2-dev uuid-dev git libstdc++-12-dev
RUN swiftly install --progress-file /dev/null --use 6.1
RUN swiftly install --progress-file /dev/null --use 6.2
RUN swift --version
2 changes: 2 additions & 0 deletions wp_api/src/wp_com/support_tickets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ pub struct CreateSupportTicketParams {
#[uniffi(default = [])]
pub tags: Vec<String>,
#[uniffi(default = [])]
pub encrypted_log_ids: Vec<String>,
#[uniffi(default = [])]
#[serde(skip)]
pub attachments: Vec<String>,
}
Expand Down
1 change: 1 addition & 0 deletions wp_com_e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
tokio = { workspace = true, features = ["full"] }
tokio-stream = { workspace = true }
uuid = { workspace = true }
wp_api = { path = "../wp_api", features = [ "reqwest-request-executor" ] }

[[bin]]
Expand Down
2 changes: 2 additions & 0 deletions wp_com_e2e/src/support_tickets_test.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use uuid::Uuid;
use wp_api::wp_com::{
client::WpComApiClient,
support_tickets::{
Expand Down Expand Up @@ -54,6 +55,7 @@ async fn create_conversation(client: &WpComApiClient) -> anyhow::Result<SupportC
wpcom_site_id: None,
tags: vec!["jetpack_mobile".to_string(), "test".to_string()],
attachments: vec![],
encrypted_log_ids: vec![Uuid::new_v4().to_string()],
})
.await?
.data;
Expand Down