Skip to content

[swift6] Run the sample tests against https://petstore.swagger.io - #25203

Open
spigo wants to merge 1 commit into
OpenAPITools:masterfrom
spigo:swift6-sample-tests-https
Open

spigo wants to merge 1 commit into
OpenAPITools:masterfrom
spigo:swift6-sample-tests-https

Conversation

@spigo

@spigo spigo commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

The Bitrise swift6 job currently fails on every PR that touches the swift6 samples (e.g. #25188 to #25194). The test apps call http://petstore.swagger.io:80/v2, the spec's host, and petstore.swagger.io now answers plain http with a 302 to https://petstore.swagger.io:443/.... On the iOS 26 simulator used by CI, URLSession re-sends the redirected POST as a GET, so addPet and placeOrder fail with 405 and the dependent get/delete tests fail with 404 or time out. That's 14 failures in alamofireLibrary, and the script stops there, so the other samples' tests never run.

This sets PetstoreClientAPIConfiguration.shared.basePath = "https://petstore.swagger.io/v2" in didFinishLaunching of the nine swift6 test host apps run by swift6_test_all.sh. Specs and generated samples are unchanged: default uses the shared 2.0 petstore spec, and the Swift-specific spec also feeds the swift5 samples, so changing the host there would touch many unrelated samples.

Checked: all nine test projects build with build-for-testing, and addPet, getPetById, placeOrder and deletePet succeed against https://petstore.swagger.io/v2 with the generated client. macOS 27's URLSession upgrades the http request to https on its own, which is why the failure doesn't reproduce on newer OS versions.

PR checklist


Summary by cubic

Fixes the Bitrise swift6 CI job, which fails on every PR that touches the swift6 samples. The test apps call http://petstore.swagger.io:80/v2, the spec's host, and petstore.swagger.io now answers plain http with a 302 to https://petstore.swagger.io:443/.... On the iOS 26 simulator used by CI, URLSession re-sends the redirected POST as a GET, so addPet and placeOrder fail with 405 and the dependent get/delete tests fail with 404 or time out.

Sets PetstoreClientAPIConfiguration.shared.basePath to https://petstore.swagger.io/v2 in didFinishLaunching of the nine swift6 test host apps run by swift6_test_all.sh, adding the missing PetstoreClient import where needed. Specs and generated samples are unchanged. macOS 27's URLSession upgrades the http request to https on its own, which is why the failure doesn't reproduce on newer OS versions.

Written for commit 385c872. Summary will update on new commits.

View guided diff

petstore.swagger.io now answers plain http with a 302 to https. On the
iOS 26 simulator used by CI, the redirected POST is re-sent as a GET, so
creating pets and placing orders fails with 405 and the dependent tests
fail with 404 or time out. Point the test apps of the nine swift6 samples
at https://petstore.swagger.io/v2 at launch.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 9 files

View guided diff | Re-trigger cubic

This branch has not been deployed

No deployments
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.

1 participant