-
Notifications
You must be signed in to change notification settings - Fork 167
Add data loading test helpers for Swift Testing and draft contributor information about writing tests #1362
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
base: main
Are you sure you want to change the base?
Conversation
…ion for new tests
heckj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(ignore if it's not useful - just saw the PR and stopped in to look)
| - Prefer small test inputs that ideally use a virtual file system for both reading and writing. | ||
| - Consider using parameterized tests if you're making the same verifications in multiple configurations or on multiple elements. | ||
| - Think about what information would be helpful to someone else who might debug that test case if it fails in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't quite sure what it is that I should do with the thinking about this. I get the reason you're asking for the consideration, but am unsure of how to apply that consideration into a test. Any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added both some more content and a couple of examples to this list item in 82c7138
| We recommend that you use [Swift Testing](https://developer.apple.com/documentation/testing) when you add new tests. | ||
| Currently there are few existing tests to draw inspiration from, so here are a few recommendations: | ||
| - Prefer small test inputs that ideally use a virtual file system for both reading and writing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any notes or internal docs on what functions to use, or examples to reference, that use the virtual file system setup? That would be great to point to, if we can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can probably update each bullet to include an example that's both using Swift Testing and one that uses XCTest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added one ore more additional paragraphs of explanation in 82c7138
I don't know if that made it too long but I felt that it was better to err in that direction.
Co-authored-by: Joseph Heck <j_heck@apple.com>
|
@swift-ci please test |
|
@swift-ci please test |
Bug/issue #, if applicable:
Summary
This PR does 3 things to enable the team to start adopting Swift Testing:
let context = try await load(catalog: ...)etc.Dependencies
None
Testing
Nothing in particular. This is a test-only / documentation-only change.
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
AddedUpdated tests./bin/testscript and it succeeded