Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(swift): move swift smoke-tests to an ios example app (#7)
## Which problem is this PR solving? This change moves the swift smoke tests from a regular unit test into an ios example app. This is a necessary prerequisite to being able to test any UI auto-instrumentation. It also brings things more into line with the Android smoke tests. Note: The library still targets ios, macos, watchos, etc, but the new smoke test is explicitly iOS. We'll eventually want to add smoke tests for other platforms we support. But the implementation of auto-instrumentation is likely to vary significantly by platform. For now, we'll just focus on iOS. ## Short description of the changes The code changes themselves are pretty minimal. Instead of the test directly sending a span, for example, it now clicks the button: `app.buttons["Send simple span"].tap()`. The complicated part is the project structure. This repo is a swift package, which comes with a few constraints: * The library itself has to be at the top level of the repo. * iOS app targets cannot be part of a swift package. To work around this, I had to create a .xcodeproj for the example app in a subdirectory. Unfortunately, Xcode projects can't depend on libraries in their parent directories. So, to work around _that_, I had to create a `.xcworkspace` to contain both the library and the example app projects. That fixes the dependency problem, and also provides the schemas for `xcodebuild` to run the tests from the command line. The repo structure ends up looking like this: ``` repo/ Workspace.xcworkspace Package.swift # library package definition Sources/ Honeycomb/ # library source Tests/ Honeycomb/ # library unit tests Examples/ SmokeTest/ SmokeTest.xcodeproj # example app project SmokeTest/ # example app source SmokeTestTests/ # example app unit tests (unused placeholder) SmokeTestUITests/ # example app smoke tests ``` There is also a minor fix to rename "Api" to "API" in API names, to conform with platform conventions. ## How to verify that this has the expected result `make smoke` still works the same.
- Loading branch information