You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's wasteful to send the entire JSON content of an argument as the ID
for an argument. Use the SHA256 instead.
### Motivation:
The JSON string for each parameterized test argument can be very large;
for one sample project, each argument was half a kilobyte, multiplied by
~10,000 cases and it starts to add up.
This PR standardizes argument IDs as SHA256 hashes. I considered doing
this only when it would be profitable to do so (e.g. if the JSON
encoding is less than 256 bits), but this makes collisions more likely
since we wouldn't be able to guarantee the distribution of bytes that
SHA256 gives us. But if that's not really a concern, it's easy enough to
only perform this transformation when the encoded input is >32 bytes.
Fixes rdar://118992957
### Modifications:
- Adds a `_TestingUtilities` module and moves SHA256.swift into it
- Imports that from both TestingMacros and Testing
- This required rebuilding it a 2nd time while building TestingMacros in
CMake, which I think is acceptable since it's just one file for now.
### Checklist:
- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
0 commit comments