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

Conversation

tmaly1980
Copy link

The docs for unit testing pure swift packages was not clear, this adds some use cases to make it more obvious.

NOTE: I just noticed the comment about saying this is not the correct location to submit a PR since it's autogenerated, but I cannot find the proper location. I cannot find run_tests anywhere in the docs repo and I don't see the markdown file anywhere in the primary fastlane repo. Please advise.

Adding example for running unit tests on a pure swift package (SPM)
Adding notes for package_path
@google-cla
Copy link

google-cla bot commented Jun 13, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Member

@rogerluan rogerluan left a comment

Choose a reason for hiding this comment

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

Hi @tmaly1980 👋 Thanks for improving fastlane docs!

This PR touches a file in the /generated/ folder, which means it will be overwritten on the next deploy. You want to actually change code here: https://github.com/fastlane/fastlane/blob/0495da3504f8506587161c5ffb468f9694e65635/fastlane/lib/fastlane/actions/run_tests.rb#L93

Could you open a PR on fastlane main repo instead, updating the code above? When you do so, please close this one as it will be obsolete 🙏

Thanks again!

```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

# run tests on a pure swift package (SPM), no xcodeproj or xcworkspace required
run_tests(
package_path: ".",
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

Comment on lines +202 to +203
result_bundle: true, # Last two lines may be required for proper xcresults output
output_directory: Dir.pwd + "/test_output"
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"

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.

2 participants