home.social

#swifttesting β€” Public Fediverse posts

Live and recent posts from across the Fediverse tagged #swifttesting, aggregated by home.social.

  1. #buildInPublic #iosDev #coreData #swiftTesting

    So I now have a start at a merge strategy I can test. Note that in the case of UUID conflicts between inbound and existing entities I’m taking the inbound UUID, so that if I modify the local storage it doesn't trigger another modification on the remote - a β€œsync loop”. It is still possible to get duplicates locally by creating a new Tune (with a UUID) and then modifying user data to be identical to an existing Tune with a different UUID.
    8/n

  2. #buildInPublic #iosDev #coreData #swiftTesting

    new merge rule:

    if inbound has UUID {
    if there is existing with same UUID {
    update existing with user data from most recently modified
    } else { //no UUID match
    if existing with same user data {
    update existing with incoming UUID
    } else { //no user data match
    insert new with incoming UUID and user data
    }
    }
    } else {//no incoming UUID
    insert with new UUID
    }
    7/n

  3. #buildInPublic #iosDev #coreData #swiftTesting

    To see if inbound changes apply, I need an invariant identifier so I can tell if I've seen this object before. I don't have one, so I need to add a UUID

    6/n

  4. #buildInPublic #iosDev #coreData #swiftTesting

    Directly editable attributes are displayName, isFavourite and Notes, others are set by the app. To properly merge logic I must decide
    - is an inbound Tune identical to an existing one
    - should changes to an inbound tune apply to an existing one.

    The rule will be:
    A - an inbound tune with identical displayName+notes to an existing one is considered identical
    B - isFavourite will be set if either the existing or inbound tune has it set

    5/n

  5. #buildInPublic #iosDev #coreData #swiftTesting

    So the obvious next step is to be able to import Tune - they're my first entity, and in the real app Tunes can be imported from existing datastores and edited via a text editor.

    In my existing basic data model I have:

    Tune (inherited from Searchable)
    collatingName : String
    createdDateTime : Date
    displayName : String
    isFavourite : Boolean
    modifiedDateTime : Date
    notes : String

    Tune - extension
    tuneSets : (many:many) to Set

    4/n

  6. #buildInPublic #iosDev #coreData #swiftTesting

    I'm going to need test data for the obvious CRUD scenarios, but also special cases to support merging sets and collections, as well as modifying a previously synced entity. The ability to import a text/JSON file would allow me to test merge logic in a repeatable way without worrying about actually setting up cloud sync.

    3/n

  7. Parameterized test output in SwiftTesting can be opaque. Conforming to πΆπ‘’π‘ π‘‘π‘œπ‘šπ‘‡π‘’π‘ π‘‘π‘†π‘‘π‘Ÿπ‘–π‘›π‘”πΆπ‘œπ‘›π‘£π‘’π‘Ÿπ‘‘π‘–π‘π‘™π‘’ produces clear descriptions of exactly which parameters caused a failure.

    πŸ”—: craftingswift.dev/articles/imp by Felipe Espinoza

    #SwiftTesting #Testing #iOSDev

  8. Parameterized test output in SwiftTesting can be opaque. Conforming to πΆπ‘’π‘ π‘‘π‘œπ‘šπ‘‡π‘’π‘ π‘‘π‘†π‘‘π‘Ÿπ‘–π‘›π‘”πΆπ‘œπ‘›π‘£π‘’π‘Ÿπ‘‘π‘–π‘π‘™π‘’ produces clear descriptions of exactly which parameters caused a failure.

    πŸ”—: craftingswift.dev/articles/imp by Felipe Espinoza

    #SwiftTesting #Testing #iOSDev

  9. Parameterized test output in SwiftTesting can be opaque. Conforming to πΆπ‘’π‘ π‘‘π‘œπ‘šπ‘‡π‘’π‘ π‘‘π‘†π‘‘π‘Ÿπ‘–π‘›π‘”πΆπ‘œπ‘›π‘£π‘’π‘Ÿπ‘‘π‘–π‘π‘™π‘’ produces clear descriptions of exactly which parameters caused a failure.

    πŸ”—: craftingswift.dev/articles/imp by Felipe Espinoza

    #SwiftTesting #Testing #iOSDev

  10. Parameterized test output in SwiftTesting can be opaque. Conforming to πΆπ‘’π‘ π‘‘π‘œπ‘šπ‘‡π‘’π‘ π‘‘π‘†π‘‘π‘Ÿπ‘–π‘›π‘”πΆπ‘œπ‘›π‘£π‘’π‘Ÿπ‘‘π‘–π‘π‘™π‘’ produces clear descriptions of exactly which parameters caused a failure.

    πŸ”—: craftingswift.dev/articles/imp by Felipe Espinoza

    #SwiftTesting #Testing #iOSDev

  11. #buildInPublic #iosDev #coreData #swiftTesting

    Since I’m eventually going to have to take a populated database and convert it from the old model to the new model, I’m going to tag the current repo so I can come back to it and build my test data. I should build a test database now that covers all the cases, but I am pretty sure that I’ll think of more as I go along.

    Nevertheless, first order of business is to build some infrastructure to populate the test database.

    2/n

  12. #buildInPublic #iosDev #coreData #swiftTesting

    Since I’m eventually going to have to take a populated database and convert it from the old model to the new model, I’m going to tag the current repo so I can come back to it and build my test data. I should build a test database now that covers all the cases, but I am pretty sure that I’ll think of more as I go along.

    Nevertheless, first order of business is to build some infrastructure to populate the test database.

    2/n

  13. #buildInPublic #iosDev #coreData #swiftTesting

    Since I’m eventually going to have to take a populated database and convert it from the old model to the new model, I’m going to tag the current repo so I can come back to it and build my test data. I should build a test database now that covers all the cases, but I am pretty sure that I’ll think of more as I go along.

    Nevertheless, first order of business is to build some infrastructure to populate the test database.

    2/n

  14. #buildInPublic #iosDev #coreData #swiftTesting

    Since I’m eventually going to have to take a populated database and convert it from the old model to the new model, I’m going to tag the current repo so I can come back to it and build my test data. I should build a test database now that covers all the cases, but I am pretty sure that I’ll think of more as I go along.

    Nevertheless, first order of business is to build some infrastructure to populate the test database.

    2/n

  15. #buildInPublic #iosDev #coreData #swiftTesting

    Since I’m eventually going to have to take a populated database and convert it from the old model to the new model, I’m going to tag the current repo so I can come back to it and build my test data. I should build a test database now that covers all the cases, but I am pretty sure that I’ll think of more as I go along.

    Nevertheless, first order of business is to build some infrastructure to populate the test database.

    2/n

  16. #buildInPublic #iosDev
    Back to this after a hiatus of several weeks. Starting a new thread

    previous thread is here mastodon.social/@Tom_frog/1156

    I'm going to need to develop the alternate #coreData model described in the previous thread, then develop a data migration. Finally, I’ll need to sync and deduplicate. I will use the the #swiftTesting functions I added in the first phase to test the migration.

    staying well away from AI since I want to actually understand what I’m doing at the end.

    1/n

  17. #buildInPublic #iosDev
    Back to this after a hiatus of several weeks. Starting a new thread

    previous thread is here mastodon.social/@Tom_frog/1156

    I'm going to need to develop the alternate #coreData model described in the previous thread, then develop a data migration. Finally, I’ll need to sync and deduplicate. I will use the the #swiftTesting functions I added in the first phase to test the migration.

    staying well away from AI since I want to actually understand what I’m doing at the end.

    1/n

  18. #buildInPublic #iosDev
    Back to this after a hiatus of several weeks. Starting a new thread

    previous thread is here mastodon.social/@Tom_frog/1156

    I'm going to need to develop the alternate #coreData model described in the previous thread, then develop a data migration. Finally, I’ll need to sync and deduplicate. I will use the the #swiftTesting functions I added in the first phase to test the migration.

    staying well away from AI since I want to actually understand what I’m doing at the end.

    1/n

  19. #buildInPublic #iosDev
    Back to this after a hiatus of several weeks. Starting a new thread

    previous thread is here mastodon.social/@Tom_frog/1156

    I'm going to need to develop the alternate #coreData model described in the previous thread, then develop a data migration. Finally, I’ll need to sync and deduplicate. I will use the the #swiftTesting functions I added in the first phase to test the migration.

    staying well away from AI since I want to actually understand what I’m doing at the end.

    1/n

  20. #buildInPublic #iosDev
    Back to this after a hiatus of several weeks. Starting a new thread

    previous thread is here mastodon.social/@Tom_frog/1156

    I'm going to need to develop the alternate #coreData model described in the previous thread, then develop a data migration. Finally, I’ll need to sync and deduplicate. I will use the the #swiftTesting functions I added in the first phase to test the migration.

    staying well away from AI since I want to actually understand what I’m doing at the end.

    1/n

  21. Interop between XCTest and Swift Testing? In the economy? It's more likely than you think.

    Legitimately, I'm really excited for this. This'll enable much more consistent set of tooling that can easily be used in Swift Testing and in XCTest. It'll also make migrating from XCTest to Swift Testing much more simpler and much safer.

    Go leave feedback at forums.swift.org/t/st-0021-tar

    #SwiftLang #XCTest #SwiftTesting #UnitTesting

  22. Testing various permutations. I'm so glad I built the app in a way that this stuff doesn't need loading the GUI. I just have to go and look at all the outputted PDFs to sanity check them.

    #testing #SwiftTesting #BuildInPublic

  23. My solution uses a combination of macOS accessibility APIs and CGEvents directly (not keyDown), the former of which understands the whereabouts of the simulator, the latter for how to find the center of the viewport, set up a two-finger gesture by spawning at the center, option-dragging to a specified input distance, option-shift-dragging to a specified coordinate, then performing one or more gestures therein.

    There has to be a better way!?

    #RandomForms #swiftui #SwiftTesting #macos

  24. After Swift Testing added support for image attachments on apple platforms and windows platforms (insert 90s-era M$ insult here), they had realized they really should consolidate the different AttachableAs${PLATFORM_SPECIFIC_IMAGE_TYPE} protocols down into just a single AttachableAsImage protocol that each platform needs to conform to.

    This is just large enough of a change to require evolution review, which I volunteered to manage! If you have thoughts, please add them to forums.swift.org/t/st-0017-con (or message me on the swift forums).

    The review period started some 30 minutes ago and runs through the end of October 30th!

    #SwiftLang #Testing #SwiftTesting

  25. Stream last night went well! Even learned some more about Swift Testing and serialization.
    Here's my full recap jaywilson.zip/posts/2025/05/01

    #buildInPublic #Swif #swifttesting

  26. Stream last night went well! Even learned some more about Swift Testing and serialization.
    Here's my full recap jaywilson.zip/posts/2025/05/01

    #buildInPublic #Swif #swifttesting

  27. Stream last night went well! Even learned some more about Swift Testing and serialization.
    Here's my full recap jaywilson.zip/posts/2025/05/01

    #buildInPublic #Swif #swifttesting

  28. Stream last night went well! Even learned some more about Swift Testing and serialization.
    Here's my full recap jaywilson.zip/posts/2025/05/01

    #buildInPublic #Swif #swifttesting

  29. Stream last night went well! Even learned some more about Swift Testing and serialization.
    Here's my full recap jaywilson.zip/posts/2025/05/01

    #buildInPublic #Swif #swifttesting

  30. Here's a post on making sure your SwiftTesting parameterised tests show up in the test navigator with nice names using `CustomTestStringConvertible`

    paul-samuels.com/blog/2025/03/

    #swifttesting #swift

  31. It just hit me - because Swift Testing allows nesting of test suites, you can now have a master suite that contains a suite for testing internal implementation and a suite for testing public interface. So neat

    #tdd #swifttesting

  32. Writing tests and improving my test coverage just helped me to find a few new issues I had, including code paths which weren't called but should have been.
    Tests have saved me a lot of trouble.
    I think I get more and more convinced that writing tests is very useful (still depending on the situation).

    Swift Testing makes this so much easier!

    #swiftTesting #swiftlang

  33. We created a little app for iOS and Mac developers to make it easier to migrate Swift XCTests to the Swift Testing framework: furnacecreek.org/testpiler/

    #Swift #SwiftTesting #iOSDev

  34. Does anyone know how to make it so that #Xcode doesn't totally lose its shit every time I start a #SwiftTesting test? My current workaround is I have to pick a different tab in the left sidebar and then it settles down.

  35. While awaiting the #GluSight app review, I finally focus on rewriting unit tests with the new Swift-Testing framework. Once most are done, I’ll replace Quick & Nimble, though they did serve their purpose. I also want to reduce dependencies, and #SwiftTesting is rather elegant.

  36. It's my first challenge! As a side project, I created a website last month to publish English articles and wrote several articles so that I could post weekly. Today, I am happy to share my first article with you.
    This article is an overview of confirmations, the first half of the contents of Swift Testing, about which I spoke in Japan.
    laprasdrum.com/swift-testing/i #swift #testing #swifttesting

  37. You are better off mocking URLSession than using a URLProtocol for mocking HTTP requests in your tests. If you don’t want to just take my word for it, you can read about why in my latest blog post: nicksloan.com/posts/mocking-ur #swift #testing #swifttesting

  38. If folks are looking for using Swift Testing with Vapor, you'll encounter all sort of issues.

    Here is something that might help you getting out of troubles:
    github.com/vapor/vapor/issues/

    It's using Lock from @mattiem ; of course. Who would imagine solving a swift concurrency issue without Matt work on it? 😜

    #Swift #Vapor #SwiftTesting #SwiftConcurrency

  39. Is #swifttesting not able to understand actor isolation? Here it's complaining that my Regex is not Sendable, but I already isolated it to a global actor.

  40. As part of the iOSDevUK conference, there are workshops at the start and end of the conference. Daniel Steinberg @dimsumthinking is running a workshop on Exploring Swift Testing. See iosdevuk.com/

    #iOS #Swift #SwiftTesting #iOSDevUK @iosdevuk

  41. #SwiftTesting questions regarding SourceLocation:
    - What is fileID for?
    - How is column used?

    Are these fields for writing macros, and have nothing to do with SwiftTesting?

  42. @polpielladev Good overview!
    There is so much good stuff in #SwiftTesting :
    Grouping and sub-grouping tests by suites, parameterized tests, adding traits like bug tracker links (!!) for context, disabling tests temporarily with β€˜withKnownIssue’, …
    But my favorite feature is the check for specific error types and cases. This in combination with typed throws in #Swift6 🀯

  43. #SwiftTesting in #Xcode16 looks so good 🀩
    And I enjoyed the #WWDC24 videos by Dorothy, Jonathan and Stuart. Although some of the shown examples in the videos didn’t make much sense, the capabilities and the intentions of the framework became clear to me.

    I'm hyped and so looking forward to use this!