Comments (15)
Expanded out of #22
from mobile.
XCTest is now OSS, could make life easier.
from mobile.
The open-source implementation of XCTest is a simple program that prints to stdout. Last we spoke, this project involved IPC, some reverse-engineering of iOS simulator internals, and more--open-source XCTest isn't going to be of much help there.
from mobile.
^ This is a legit point
from mobile.
Alright so, based on what I learned in code spelunking in Injection for Xcode, here's what I think should happen.
Let's just call it instatests for now. Create a gem called cocoapods-instatests
.
Why a CocoaPods plugin? Well we need to add code to the app to start listening out for , people shouldn't need to have it on every computer and ideally it shouldn't get shipped with your app's source, sounds exactly like cocoapods-keys.
The code inside the pod needs to:
- Wait until an XCTest session is about to close, check for any instatests servers.
- If it doesn't find one, close like normal.
- If one exists, create a connection ( Injection uses sockets, could we use NSXPC?)
- Receive NSBundles, run the code as tests in XCTest
- The code can be added entire as a
#ifdef DEBUG
so it won't go to prod
This plugin has a command pod instatests
which starts up a guard-like server. This detects saves, and creates a bundle representing the changes. These get passed to the pod's server, ran, then it gets test results back, these can use NSNotifications to let you know if it passed/failed.
Once a working build is done, then I can look at standardizing all the communication points.
from mobile.
could we use NSXPC?
Depends. How will the bundles with new code be compiled? By Xcode or do you want to do a stand-alone thing, possibly with a Clang compilation database?
from mobile.
Simplest feels to be the same as injection - read the build log, find the section for that file, and reuse that. In injection that .o
is linked into a blank bundle, which gets passed across the connection.
Though I do want to consult Diamond's reloaded before making the first approach
from mobile.
Current feels on a name, xctestjam
from mobile.
Don't think XPC is probably the right communication method, weirdly enough, JSCore should have a working websocket, could use that as the intermediary for the client/server to bi-directionally communicate. Meta.
from mobile.
Got a web socket to connect between a ruby webserver and a WKWebView websocket - looks like the simplest way to start
from mobile.
Now that I've started this, https://github.com/orta/cocoapods-xcautotest/
I'd like to try scope 1.0 as "runs tests, reliably" and 2.0 as "runs tests reliably, in the background, on a separate sim."
This looks a bit tough, but definitely doable, as it looks like I'll have to create ruby bindings for the frameworks generated by https://github.com/facebook/FBSimulatorControl - they have a command-line tool but it looks like it depends on having Carthage, which I'd rather not have as a dependency.
from mobile.
but it looks like it depends on having Carthage
Seems to only be for testing (OCMock).
from mobile.
Nah, it is used for the the command-line tool itself - the frameworks themselves are dependecy-less - https://github.com/facebook/FBSimulatorControl/tree/master/fbsimctl
from mobile.
@orta @alloy As far as Carthage goes we need it for two reasons:
- For
OCMock
tests for the Frameworks. I'm all for ripping out this dependency by replacing with hand-written doubles. - For
Swifter
withfbsimctl
, which can run with an embedded HTTP Server.
If you need to build the Frameworks (XCTestBoostrap
/FBSimulatorControl
/FBDeviceControl
), then you don't need any use of Carthage whatsoever. If you want to use the fbsimctl
command-line you'll need it for building the fbsimctl
executable. If you have some suggestions here, please let me know.
If you're interested in linking against the XCTestBootstrap
framework from Ruby with a FFI and avoiding the fbsimctl
executable, you should look at FBTestManagerReporter
. These are the Delegate methods that Xcode/xcodebuild
would get if launched via these tools. The XCTest
protocols themselves are really quite good and should be more than sufficient for making a custom reporter. And for Simulators, XCTestBootstrap
enables you to run against multiple booted Simulators on the same host.
from mobile.
Awesome - thanks @lawrencelomax
from mobile.
Related Issues (20)
- Blog Post: Getting started with React Native HOT 6
- Blog Post: Migrating Force/Microgravity to OSS by Default HOT 2
- Blog Post: Artsy's usage of Bots
- Analytics on Mobile HOT 1
- Public Speaking HOT 5
- Dev tools blog post
- Strongify/Weakify dance blog post HOT 1
- README needs an update again HOT 1
- PR a day HOT 3
- Colour palette for Artsy OSS (general / mobile projects) HOT 5
- Artsy OSS / Mobile resources HOT 4
- Drawing and programming views HOT 1
- Breaking into OSS in Cocoa HOT 1
- Create a blog post with βrulesβ on communication and design, specifically in the context of OSS. HOT 1
- Process HOT 11
- Blog post: MVVM + FBSnapshots for the greater good
- Blog Post: SDWebImage and Snapshot Testing HOT 1
- Incorrect links in the playbook.md file HOT 2
- Bug Report Process HOT 2
- Post:How the design of CocoaDocs influences Danger's infrastructure HOT 2
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 mobile.