Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding documentation for pure swift package unit testing #1198

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
16 changes: 14 additions & 2 deletions docs/generated/actions/run_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Returns | Outputs hash of results with the following keys: :number_of_tests, :nu



## 6 Examples
## 7 Examples

```ruby
run_tests
Expand All @@ -192,6 +192,18 @@ run_tests(
)
```

```ruby
# run tests on a pure swift package (SPM), no xcodeproj or xcworkspace required
run_tests(
package_path: ".",
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps provide a more didactic example here? Like:

Suggested change
package_path: ".",
package_path: "/path/to/package/directory" # The path to the directory where your Package.swift is in

scheme: "MySwiftCode-Package", # Must have -Package
Copy link
Member

Choose a reason for hiding this comment

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

Same here, e.g.:

Suggested change
scheme: "MySwiftCode-Package", # Must have -Package
scheme: "MySwiftPackage-Package", # Append "-Package" to your Swift Package name

clean: true,
device: "iPhone 11 Pro", # Required for destination
result_bundle: true, # Last two lines may be required for proper xcresults output
output_directory: Dir.pwd + "/test_output"
Comment on lines +202 to +203
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps this would be better formatted like this?

Suggested change
result_bundle: true, # Last two lines may be required for proper xcresults output
output_directory: Dir.pwd + "/test_output"
# These last two lines may be required for proper .xcresult output:
result_bundle: true,
output_directory: Dir.pwd + "/test_output"

)
```

```ruby
# Build For Testing
run_tests(
Expand Down Expand Up @@ -225,7 +237,7 @@ Key | Description | Default
----|-------------|--------
`workspace` | Path to the workspace file |
`project` | Path to the project file |
`package_path` | Path to the Swift Package |
`package_path` | Path to the Swift Package (ie "."), required if it's a pure Swift Package with no project or workspace file |
`scheme` | The project's scheme. Make sure it's marked as `Shared` |
`device` | The name of the simulator type you want to run tests on (e.g. 'iPhone 6' or 'iPhone SE (2nd generation) (14.5)') |
`devices` | Array of devices to run the tests on (e.g. ['iPhone 6', 'iPad Air', 'iPhone SE (2nd generation) (14.5)']) |
Expand Down