{"id":19311292,"url":"https://github.com/derekselander/lolzwagon","last_synced_at":"2025-04-22T14:30:36.798Z","repository":{"id":152185665,"uuid":"167875228","full_name":"DerekSelander/LOLzwagon","owner":"DerekSelander","description":" Significantly bumps up your iOS XCTest code coverage and makes all unit tests pass... by crippling them","archived":false,"fork":false,"pushed_at":"2019-02-05T22:00:51.000Z","size":2676,"stargazers_count":31,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T00:35:54.335Z","etag":null,"topics":["ios","lolzwagon","macos","test","testing","unittesting","volkswagen","xcode"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DerekSelander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-28T00:32:22.000Z","updated_at":"2025-02-24T21:36:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"945fe7fa-16eb-46f6-800e-520042c6f198","html_url":"https://github.com/DerekSelander/LOLzwagon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekSelander%2FLOLzwagon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekSelander%2FLOLzwagon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekSelander%2FLOLzwagon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerekSelander%2FLOLzwagon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DerekSelander","download_url":"https://codeload.github.com/DerekSelander/LOLzwagon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250258766,"owners_count":21400966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","lolzwagon","macos","test","testing","unittesting","volkswagen","xcode"],"created_at":"2024-11-10T00:28:34.392Z","updated_at":"2025-04-22T14:30:36.793Z","avatar_url":"https://github.com/DerekSelander.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"right\"\u003e\u003csub\u003e\u003csup\u003eBeware of the dancing Gandalf...\u003c/sub\u003e\u003c/sup\u003e\u003c/p\u003e\n\u003ch1 align=\"center\"\u003e🇺🇸🇺🇸 LOLzwagon 🇺🇸🇺🇸\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eSignificantly bumps up your iOS XCTest code coverage and makes all unit tests pass... by crippling them\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"120\" height=\"120\" src=\"https://github.com/DerekSelander/LOLzwagon/raw/master/media/logo.png\"\u003e\n  \u003cbr /\u003e\n  \u003ci\u003e\"You know a repo is legit if it has a logo for it\"\u003c/i\u003e\n\u003c/p\u003e\n\u003ch3\u003eAre you...\u003c/h3\u003e \n\n* Looking to get a raise with the least amount of work possible?\n* Having to deal with a superior and explain to them on numerous occassions that it's extremely difficult (if not impossible) to get past 95% of code completion in your repo?\n* In an office argument with the backened team and want to prove to them that the bug is on their side due to how well tested your code is?\n\n\u003ch3\u003eIF YOU SAID \"YES\" TO ANY OF THE ABOVE, THIS REPO IS FOR YOU!\u003c/h3\u003e\n\nThis code will neuter all `XCTAssert*`/`XCTestExpectation` functions/methods called on for testing failures. In addition, this dylib will greatly increase the code coverage of all modules which contain code coverage.\n\nCheck them pics out!\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"800\" src=\"https://github.com/DerekSelander/LOLzwagon/raw/master/media/screen1.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"800\" src=\"https://github.com/DerekSelander/LOLzwagon/raw/master/media/screen2.png\"\u003e\n\u003c/p\u003e\n\n## Compiling\n\nDownload the Xcode project and build the **LOLzwagon Xcode scheme**. \n\n```\nxcodebuild -project LOLzwagon.xcodeproj -scheme LOLzwagon -sdk iphonesimulator -config Debug\n```\n\nThe above example used the **Debug** scheme, but feel free to also use the **Release** or the **GimmeARaise** scheme, but more on that in a sec...\n\nAfter successfully compiling, the `LOLzwagon` dylib will be placed at the following directory:\n\n```\n/usr/local/lib/libLOLzwagon.dylib\n```\n\nMake sure you have write access to `/usr/local/lib/` otherwise everything below will fail.\n\nIf you load this framework into your process, it will cripple Xcode's Unit Testing! 🎉 Check out the **Integrating** section for more info.\n\n\n## Testing\n\nBundled into the Xcode project is a scheme called **CodeCoverage** which includes unit tests. Run these unit tests and observe the `XCTest` scenarios.\n\n```\nxcodebuild test -project LOLzwagon.xcodeproj -scheme CodeCoverage -enableCodeCoverage YES -destination 'platform=iOS Simulator,OS=12.1,name=iPhone XS'  -sdk iphonesimulator -config Debug \n```\nThe logic in these tests should fail, but OMG, they'll pass!\n\n## Integrating\n\nThere are several ways to get this code to run on your 5-year-old CI/CD mac mini and loaded into test builds.\n\nLet's go through some of the ways that you can do this...\n\n1. Just compile the `LOLzwagon.m` file into your application. This is definitely not recommended, since your `git`/`svn`/whatever credentials are tied to your action.\n2. The second to worst idea is to use the **DYLD_INSERT_LIBRARIES** environment variable. This environment variable loads  framework(s) into a process before anything else is loaded (while still honoring it's `LC_LOAD_DYLIB` dependencies first). Again, it's still tied to source control (especially if a shared Xcode scheme), so still not a good idea.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"600\" src=\"https://github.com/DerekSelander/LOLzwagon/raw/master/media/scheme.png\"\u003e\n\u003c/p\u003e\n\n3. A more subtle way is to use a **launch agent** to insert the `DYLD_INSERT_LIBRARIES` environment variable so it survives outside of source control. Your Jenkins/whatever build machine will likely `git clone` your repo to a specific directory. You can use a `launchd` agent to monitor the directory and perform an action if something changes.\n\nAs an example, if you want to monitor changes in the `/tmp/` directory, you can save the following into **`~/Library/LaunchAgents/com.selander.LOLzwagon.plist`**\n\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003c!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"\u003e\n\u003cplist version=\"1.0\"\u003e\n\u003cdict\u003e\n    \u003ckey\u003eLabel\u003c/key\u003e\n    \u003cstring\u003ecom.selander.LOLzwagon\u003c/string\u003e\n    \u003ckey\u003eProgramArguments\u003c/key\u003e\n    \u003carray\u003e\n        \u003cstring\u003eecho\u003c/string\u003e\n        \u003cstring\u003eYay! Working!\u003c/string\u003e\n    \u003c/array\u003e\n\u003ckey\u003eWatchPaths\u003c/key\u003e\n    \u003carray\u003e\n        \u003cstring\u003e/tmp/testdir\u003c/string\u003e\n    \u003c/array\u003e\n    \u003ckey\u003eStandardOutPath\u003c/key\u003e\n    \u003cstring\u003e/tmp/log_file.txt\u003c/string\u003e\n\u003c/dict\u003e\n\u003c/plist\u003e\n```\n\nEnable this daemon:\n\n```\nlaunchctl load -w ~/Library/LaunchAgents/com.selander.LOLzwagon.plist \n```\n\nNow, if you open up a new Terminal window, you can watch the events \n\n```\ntouch /tmp/log_file.txt \u0026\u0026 tail -f /tmp/log_file.txt \n```\n\nIn the other Terminal, trigger an event\n\n```\nmkdir /tmp/testdir\n```\n\nUsing this method, you can watch for events and add your environment variables outside of source control. Warning: this is prone to race conditions, you'll need to figure out how to get around that on your oooooooooooowwwwwwwwwn\n\n\n## Code Coverage\n\nBuilding the `Debug` config will bump the unit tests up considerably in your application, but if you really, really want to shoot high for Code Coverage, you can compile your application with the **GimmeARaise** Xcode config.\n\n```\nxcodebuild test -project LOLzwagon.xcodeproj -scheme CodeCoverage -sdk iphonesimulator -config GimmeARaise\n```\n\nWarning, this might make your Code Coverage a little too good. Might be better to make it slightly lower to glide under the radar. \n\n## How Does it Work?\n\nLOL\n\n## Bugs\n\nSDEs \u0026 SDETs write some weird shit for testing cases that this repo might not catch. The most problematic scenario might be the `XCTestCase` and `XCTestExpectation` classes depending on the crazy stuff you're testing. If you see a failing test case, please report an issue and include a generic test case to show the problem via Swift or Objective-C. Test Driven Development is an important workflow in order to make unit tests not work......\n\n \u003csub\u003e\u003csup\u003eAlso, don't use this in a production codebase... or any codebase \u003c/sub\u003e\u003c/sup\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderekselander%2Flolzwagon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderekselander%2Flolzwagon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderekselander%2Flolzwagon/lists"}