{"id":17383791,"url":"https://github.com/sunaku/tork","last_synced_at":"2025-04-05T08:08:27.901Z","repository":{"id":1108172,"uuid":"975559","full_name":"sunaku/tork","owner":"sunaku","description":"💞 Tests your Ruby code, in parallel, as you change it","archived":false,"fork":false,"pushed_at":"2017-04-01T19:34:18.000Z","size":1229,"stargazers_count":179,"open_issues_count":0,"forks_count":14,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-29T07:08:40.935Z","etag":null,"topics":["ruby","test-automation","testing-tools"],"latest_commit_sha":null,"homepage":"https://sunaku.github.io/tork/man","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunaku.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-10-10T00:58:48.000Z","updated_at":"2024-11-28T16:28:16.000Z","dependencies_parsed_at":"2022-07-06T08:04:54.329Z","dependency_job_id":null,"html_url":"https://github.com/sunaku/tork","commit_stats":null,"previous_names":[],"tags_count":94,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaku%2Ftork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaku%2Ftork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaku%2Ftork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaku%2Ftork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunaku","download_url":"https://codeload.github.com/sunaku/tork/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305935,"owners_count":20917208,"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":["ruby","test-automation","testing-tools"],"created_at":"2024-10-16T07:43:47.538Z","updated_at":"2025-04-05T08:08:27.876Z","avatar_url":"https://github.com/sunaku.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n    _______      _______\n     ___  /___________ /__\n      _  __/ __ \\  __/ /_/\n      / /_/ /_/ / / / ,\\\n      \\__/\\____/_/ /_/|_\\\n                 \u003e\u003e\u003e------\u003e\n\n* Code: \u003chttps://github.com/sunaku/tork\u003e\n* Docs: \u003chttps://sunaku.github.io/tork/man\u003e\n* Bugs: \u003chttps://github.com/sunaku/tork/issues\u003e\n\n# _Test with fork_\n\nTork runs your tests as they change, in parallel:\n\n  1. Absorbs test execution overhead into a master process.\n\n  2. Forks to inherit overhead and run test files in parallel.\n\n  3. Avoids running unchanged tests inside changed test files.\n\n## Features\n\n  * No configuration necessary: simply run `tork` to start testing *now!*\n\n  * Runs test files in parallel using fork for multi-core/CPU utilization.\n\n  * Tests *changes* your Ruby application for rapid TDD: avoids running (1)\n    unchanged test files and (2) unchanged tests inside changed test files.\n\n  * Supports MiniTest, Test::Unit, RSpec, and *any testing framework* that (1)\n    exits with a nonzero status to indicate test failures and (2) is loaded by\n    your application's `test/test_helper.rb` or `spec/spec_helper.rb` file.\n\n  * Logs the output from your tests into separate files: one log per test.\n\n  * Configurable through Ruby scripts in your current working directory.\n\n  * You can override the modular `tork*` programs with your own in $PATH.\n\n  * You can remotely control other `tork*` programs using tork-remote(1).\n\n### Architecture\n\nFollowing UNIX philosophy, Tork is composed of simple text-based programs that\n*do one thing well*.  As a result, you can even create your own user interface\nfor Tork by wrapping the tork-driver(1) program appropriately!\n\n* tork(1) is an interactive command-line user interface for tork-driver(1)\n* tork-runner(1) runs your test suite once, non-interactively, and then exits\n* tork-herald(1) monitors current directory tree and reports changed files\n* tork-driver(1) drives the engine according to the herald's observations\n* tork-engine(1) tells master to run tests and keeps track of test results\n* tork-master(1) absorbs test execution overhead and forks to run your tests\n* tork-remote(1) remotely controls any Tork program running in the same `pwd`\n* tork-notify(1) notifies you when previously passing tests fail or vice versa\n\nWhen the herald observes that files in or beneath the current directory have\nbeen written to, it tells the driver, which then commands the master to fork a\nworker process to run the tests affected by those changed files.  This is all\nperformed *automatically*.  However, to run a test file *manually*, you can:\n\n  1. Simply save the file!  When you do, Tork tries to figure out which tests\n     inside your newly saved test file have changed (using diff and regexps)\n     and then attempts to run just those.  To make it run *all* tests in your\n     saved file, simply save the file *again* without changing it.\n\n  2. Type `t` followed by a space and the file you want to run into tork(1):\n\n         # run all of test/some_test.rb\n         t test/some_test.rb\n\n         # run lines 4, 33, and 21 of test/some_test.rb\n         t test/some_test.rb 4 33 21\n\n  3. Send a `[\"run_test_file\"]` message to tork-engine(1) using tork-remote(1):\n\n         # run all of test/some_test.rb\n         echo run_test_file test/some_test.rb | tork-remote tork-engine\n\n         # run lines 4, 33, and 21 of test/some_test.rb\n         echo run_test_file test/some_test.rb 4 33 21 | tork-remote tork-engine\n\nAlternatively, you can use tork-runner(1) to run your test suite in one shot\nand then exit with a nonzero status if tests failed, similar to `rake test`.\n\n## Installation\n\n    gem install tork\n\n### Prerequisites\n\n  * Ruby 1.8.7 or 1.9.3 or newer.\n\n  * Operating system that supports POSIX signals and the `fork()` system call.\n    To check if your system qualifies, launch irb(1) and enter the following:\n\n        Process.respond_to? :fork  # must be true\n        Signal.list.key? 'TERM'    # must be true\n        Signal.list.key? 'KILL'    # must be true\n\n  * To make the tork-herald(1) program's filesystem monitoring more efficient:\n\n        gem install rb-inotify  # linux\n        gem install rb-fsevent  # macosx\n\n### Development\n\n    git clone git://github.com/sunaku/tork\n    cd tork\n    bundle install\n    bundle exec tork --help  # run it directly\n    bundle exec rake --tasks # packaging tasks\n\n## Usage\n\n### At the command line\n\n    tork --help\n\nYou can add line editing, history, and filename completion:\n\n    rlwrap -c tork\n\nYou can control tork(1) interactively from another terminal:\n\n    tork-remote tork-engine\n    # type your commands here, one per line.\n    # press Control-D to exit tork-remote(1)\n\nYou can also do the same non-interactively using a pipeline:\n\n    # run lines 4, 33, and 21 of test/some_test.rb\n    echo run_test_file test/some_test.rb 4 33 21 | tork-remote tork-engine\n\nYou can monitor your test processes from another terminal:\n\n    watch 'pgrep -f ^tork | xargs -r ps uf'\n\n### With Bundler\n\nThe `bundler` configuration helper loads a Bundler bundle into tork-master(1).\nThe `default` configuration helper does this for you automatically if there is\na `Gemfile` or `Gemfile.lock` file present in your current working directory.\n\nAs a result, you don't need to add Tork to your `Gemfile` _just_ to run tests!\nInstead, installing Tork as a Ruby gem _outside_ of your bundle is sufficient.\n\nTry it: go into any bundled application and call `tork` to run its test suite.\n\n### With MiniTest\n\nMiniTest 1.3.2 and newer contain a bug where `minitest/autorun` won't run any\ntests if someone calls `Kernel#exit` explicitly or simply loads a library\n(such as RSpec) which makes the call implicitly.  Use Tork 19.0.2+ to avoid\nthis problem or [apply this patch to the minitest library](\nhttps://github.com/seattlerb/minitest/pull/183/files ) to fix the problem.\n\n### With RSpec\n\nRSpec 2.9.0 and newer contain a bug where RSpec's autorun helper won't run any\nspecs if someone calls `Kernel#exit` explicitly or simply loads a library\n(such as Test::Unit) which makes the call implicitly.  Use Tork 19.0.2+ to\navoid this problem or [apply this patch to the rspec-core library](\nhttps://github.com/rspec/rspec-core/pull/720/files ) to fix the problem.\n\nRSpec 2.8.0 and older contain [a bug](\nhttps://github.com/sunaku/tork/issues/31 ) where a nonzero exit status (caused\nby an uncaught exception) is overridden by RSpec's `Kernel#at_exit` handler to\nbe zero, thereby falsely indicating that a spec had passed.  [This patch](\nhttps://github.com/rspec/rspec-core/pull/569/files ) fixes the problem.\n\n### With [Ruby on Rails]\n\nFor Rails 3 or newer, use the `rails` configuration helper *before* the `test`\nor `spec` helpers.  Otherwise your test helper will load Rails *before* the\nspecified `rails` configuration helper has a chance to disable class caching!\n\nFor older Rails, make sure your `config/environments/test.rb` file contains:\n\n    config.cache_classes = false\n\nFor older Rails, to use SQLite3 as your test database, install the [in-memory\ndatabase adapter][memory_test_fix].  Otherwise, you *might* face these errors:\n\n\u003e SQLite3::BusyException: database is locked\n\n\u003e cannot start a transaction within a transaction\n\nFor older Rails, to use SQLite3 as your test database along with browser-based\nacceptance testing frameworks such as Capybara, see\nhttp://www.spacevatican.org/2012/8/18/threading-the-rat/\n\n## Configuration\n\nTork looks for a configuration directory named `.tork/` inside its working\ndirectory.  The configuration directory contains specially-named Ruby scripts,\nwithin which you can query and modify the settings for various tork programs.\nSee the \"FILES\" sections in the manual pages of tork programs for details.\n\nNote that tork *does not* automatically reload changes from your configuration\ndirectory.  Consequently, you must restart tork if your configuration changes.\n\n## License\n\n[Spare A Life]: https://sunaku.github.io/vegan-for-life.html\n\u003e Like my work? :+1:  Please [spare a life] today as thanks!\n:cow::pig::chicken::fish::speak_no_evil::v::revolving_hearts:\n\nCopyright 2010 Suraj N. Kurapati \u003chttps://github.com/sunaku\u003e\n\nReleased under the ISC license.  See the LICENSE file for details.\n\n[factory_girl]: https://github.com/thoughtbot/factory_girl\n[memory_test_fix]: https://github.com/stepahn/memory_test_fix\n[parallel_tests]: https://github.com/grosser/parallel_tests\n[Ruby on Rails]: http://rubyonrails.org\n[Cucumber]: https://cukes.info\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunaku%2Ftork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunaku%2Ftork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunaku%2Ftork/lists"}