Comments (7)
Do you think it's possible to snapshot generated interface of a swift file?
The goal is to see if we can compare public interface of a file and see if it has changed ?
from swift-snapshot-testing.
@Sherlouk @stephencelis Thanks for the replies.
For .swiftinterface
it will be for Swift 5.1 for module stability.
For the memory and CPU snapshot we could use task_info
API ?
from swift-snapshot-testing.
Should we consider snapshotting memory, cpu, network (volume of data transmitted) and disk usage ?
from swift-snapshot-testing.
For URL
is there a reason you wouldn't simply compare absoluteString
also maybe an option to compare URLComponents (nicer breakdown vs URL on it's own)?
On the public interface, it sounds like an interesting idea but I'm not actually sure how that would be done. Do you have any pointers? I partnered a friend at work when he was working on Guise which creates a public interface document as part of a run script - not sure how the connection could be made!
from swift-snapshot-testing.
Hey @mackoj missed your earlier comments, sorry!
Should we consider snapshotting memory, cpu, network (volume of data transmitted) and disk usage ?
Sounds interesting! Thoughts on how to track this kind of thing, though?
Do you think it's possible to snapshot generated interface of a swift file?
The goal is to see if we can compare public interface of a file and see if it has changed ?
Not sure! Maybe with SwiftSyntax or SourceKitten! Would be an interesting tackle.
Hey @Sherlouk!
For URL is there a reason you wouldn't simply compare absoluteString also maybe an option to compare URLComponents (nicer breakdown vs URL on it's own)?
I'm not sure if @mbrandonw had some more ideas for what to do with URL. 🤔 Right now a .dump
works well to do basically what absoluteString
would do.
from swift-snapshot-testing.
Do you think it's possible to snapshot generated interface of a swift file?
In Swift 5 a .swiftinterface
file is created (link) which is a textual representation of the public/open interface for the library.
Should be fairly doable to use __XCODE_BUILT_PRODUCTS_DIR_PATHS
to load that file - snapshot it locally with the test and run a comparison.
(Should say I'm not running Swift 5 at the mo otherwise I'd jump on prototyping this, sounds like an interesting idea)
from swift-snapshot-testing.
I'm doing some spring cleaning and am closing issues that don't have an obvious fix, like this one 😄 Great discussion and ideas in this thread, though. When GitHub Discussions rolls out we should consider it as a forum for exploring new snapshot strategy ideas. Till then, if you come up with something you'd like to PR, we'd love to see it!
from swift-snapshot-testing.
Related Issues (20)
- Snapshotting.wait on UIViewController does not work if view is not referenced HOT 3
- Diffing UIImage considering imageOrientation
- Cannot use Snapshot Testing in Xcode 15 HOT 6
- [Request] Avoid automatically recording snapshots on CI HOT 3
- Xcode Cloud: Snapshot references don't match, visually the same. Locally passing HOT 1
- Left margin is not respected in view controller snapshot images on iPhone 8/SE in landscape HOT 1
- Test delays with “Timed out waiting for the exit barrier block” HOT 2
- Why the SnapshotTesting.podspec is removed? HOT 1
- Compared to vitest snapshot testing of json swift-snapshot-testing is slow HOT 1
- Ability to disable alpha channel from image snapshots HOT 1
- Snapshot Tests not Creating Xcode Groups HOT 1
- Inline snapshot testing output fails when URL request body expected contains carriage returns HOT 2
- Breaking change was introduced with minor version update HOT 2
- Enhancements to `diffTool`? HOT 2
- Test crashes when view contains Swift Charts HOT 1
- iOS 17 Snapshots have weird edges and radius HOT 3
- Add CI best practices to the readme HOT 1
- How to avoid SwiftSyntax annoyance? HOT 2
- Trait Overrides support for iOS 17
- perceptuallyCompare function has seemingly incorrect operating system check version?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-snapshot-testing.