Code Monkey home page Code Monkey logo

Comments (7)

mackoj avatar mackoj commented on July 30, 2024 2

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 ?

capture d ecran 2018-12-18 a 23 22 58

from swift-snapshot-testing.

mackoj avatar mackoj commented on July 30, 2024 1

@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.

mackoj avatar mackoj commented on July 30, 2024

Should we consider snapshotting memory, cpu, network (volume of data transmitted) and disk usage ?

from swift-snapshot-testing.

Sherlouk avatar Sherlouk commented on July 30, 2024

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.

stephencelis avatar stephencelis commented on July 30, 2024

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.

Sherlouk avatar Sherlouk commented on July 30, 2024

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.

stephencelis avatar stephencelis commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.