{"id":18716329,"url":"https://github.com/killbill/killbill-integration-tests","last_synced_at":"2025-04-12T13:30:52.488Z","repository":{"id":10294577,"uuid":"12414820","full_name":"killbill/killbill-integration-tests","owner":"killbill","description":"Kill Bill integration tests","archived":false,"fork":false,"pushed_at":"2024-09-10T06:31:08.000Z","size":694,"stargazers_count":3,"open_issues_count":0,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-26T08:12:16.870Z","etag":null,"topics":["billing","killbill","payments","subscriptions"],"latest_commit_sha":null,"homepage":"https://killbill.io","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/killbill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"MIT-LICENSE","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},"funding":{"github":["killbill"]}},"created_at":"2013-08-27T18:57:35.000Z","updated_at":"2024-09-09T08:32:03.000Z","dependencies_parsed_at":"2024-06-28T07:57:00.306Z","dependency_job_id":"9117c9f0-8788-42db-8745-a1900b7bc4f1","html_url":"https://github.com/killbill/killbill-integration-tests","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/killbill%2Fkillbill-integration-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killbill%2Fkillbill-integration-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killbill%2Fkillbill-integration-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killbill%2Fkillbill-integration-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/killbill","download_url":"https://codeload.github.com/killbill/killbill-integration-tests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248573410,"owners_count":21126824,"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":["billing","killbill","payments","subscriptions"],"created_at":"2024-11-07T13:12:19.182Z","updated_at":"2025-04-12T13:30:51.894Z","avatar_url":"https://github.com/killbill.png","language":"Ruby","funding_links":["https://github.com/sponsors/killbill"],"categories":[],"sub_categories":[],"readme":"\nkillbill-integration-tests\n==========================\n\nKill Bill ruby integration test suite.\n\nScope\n-----\n\n\nThe tests are written to be run against a running instance of Kill Bill with its default catalog (SpyCarBasic.xml). The tests depend on the gem killbill\\_client. We are running the tests using ruby 1.9.x or 2.x.\n\nTo run the tests against the KillBill Docker Image, see [the separate guide](docker/README.md).\n\nSetup\n-----\n\n* Setup the correct version of ruby (using rvm, or default installed ruby version). On Windows machines, you can use [RubyInstaller](https://rubyinstaller.org/) to install Ruby. \n* Ensure that the Gemfile points to the killbill-client gem. Open the `\u003cPROJECT_ROOT\u003e/Gemfile` and comment/uncomment the appropriate lines:\n\n```\n# \n# (gem 'killbill-client', :path =\u003e '../killbill-client-ruby').\n# (Comment or uncomment the line as appropriate)\n```\n\n* Install the required gems:\n\n```\n# From  top of integration-tests repo (https://github.com/killbill/killbill-integration-tests)\n    \n\u003e bundle install\n...\n```\n\n* Check the list of tests:\n\n```\n\u003e rake -T\nrake test:all                            # Run tests for all\nrake test:core                           # Run tests for core\nrake test:core:entitlement               # Run tests for core:entitlement\nrake test:core:invoice                   # Run tests for core:invoice\nrake test:core:payment                   # Run tests for core:payment\nrake test:core:tag                       # Run tests for core:tag\nrake test:core:usage                     # Run tests for core:usage\nrake test:multi-nodes                    # Run tests for multi-nodes\nrake test:plugins:killbill-invoice-test  # Run tests for plugins:killbill-invoice-test\nrake test:plugins:payment-test           # Run tests for plugins:payment-test\nrake test:seed                           # Run tests for seed\n```\n\nMost tests should be able to run with default kill Bill version except for the test:payment:control, which requires\nthe plugin [killbill-payment-test-plugin](https://github.com/killbill/killbill-payment-test-plugin) to be installed.\n\nStart Kill Bill locally either in Tomcat (by following the instructions in the [Getting Started]( https://docs.killbill.io/latest/getting_started.html#_tomcat) guide) or Jetty (by following the instructions in the [Development](https://docs.killbill.io/latest/development.html#_setting_up_kill_bill_in_your_development_environment) document). Open a browser window and verify that \\http://localhost:8080/index.html displays the Kill Bill home page.\n\n\nRun the tests:\n-------------\n\nBy default the tests will point to the local instance of Kill Bill `KillBillClient.url = 'http://127.0.0.1:8080'`, but that can be modified -- see test\\_base.rb.\n\nBy default, the tests use the `admin/password` admin credentials. However, you can override these by setting the `KILLBILL_ADMIN_USERNAME` and `KILLBILL_ADMIN_PASSWORD` environment variables.  \n\nFrom killbill-integration-tests, and after the setup is done, run some tests. for e.g:\n```\n\u003e rake test:core:entitlement\n```\n\nAll tests should pass.\n\n\nAbout the tests:\n----------------\n\nThe tests use the ruby client library to communicate through HTTP apis with Kill Bill. There are also a few special endpoints that we added for the tests; one of them is `/1.0/kb/test/clock` which is used to move the clock on Kill Bill back and forth. At the beginning of each test the clock is reset to its default value (2013-08-01:T06:00:00.000Z), which is arbitrary but required for writing the test assertions. During the tests, the endpoint is used to move the clock forward and generate invoices,...\n\n\nIt is advised to start from a clean database prior starting the tests since moving clock back and forth may trigger the system to act on some of the existing data. \n\n```\n# Stop Kill Bill if not already done (CTRL C will work, or kill -9 PID)\n# Reset the database tables:\n\u003e ./bin/db-helper -a clean\n# Restart Kill Bill\n\u003e ./bin/start-server -s -d \u003e /tmp/server.out 2\u003e\u00261 \u003c /dev/null \u0026\n```\n\n\nLoad/Perf Tests:\n---------------\n\nThe integration tests also offer some support to run performance/load tests. Under 'load' there is a base class `load_base.rb` that relies on the `thread/pool` gem to schedule tasks across multiple threads. It also offers the ability to profile the calls by using the profiling feature embedded into Kill Bill (https://github.com/killbill/killbill/wiki/Kill-Bill-Profiling).\n\nThe `payment_load.rb` test relies on `load_base.rb` and defines a set of Tasks. A task is a small scenario that should be run; it can be as simple as doing one call, or could comprise multiple operations. One should adjust the following parameters (currently hardcoded in the test) to suit its needs:\n* KillBillClient.url (defaults to 'http://127.0.0.1:8080') : This is set in `load_base.rb`\n* NB_ITERATIONS : number of iterations for each of the tasks with default ratio set to 1\n* NB_THREADS : number of threads that should pick from the queue of tasks\n* WITH_STATS : Whether test should gather statistics from server. It is advised to turn it off when running very large load tests since all the information will be kept in memory on the client side.\n\nIn addition to that, each task is given a ratio, which allows to limit the number of iterations for certain tasks. A ratio of 1 means that the task will be run NB_ITERATIONS times. A greater ratio will be used as a modulo factor to NB_ITERATIONS; for example if NB_ITERATIONS = 10, and ratio = 5, the task would run twice, one for iteration = 5 and once for iteration = 10. This is useful for instance to run a large number of payment calls against a dummy payment plugin and have in parallel a few calls hitting a third party sandbox.\n\nOnce the parameters have been set to the desired values, and after an existing instance of Kill Bill has been started, the only operation required is to run the test:\n\n```\n\u003e bundle exec ruby killbill-integration-tests/load/payment_load.rb \n**************************    COMPLETED LOAD TESTS (nbThreads = 1)    ***************************\nTASK Test (iterations = 1) err = 0\nTASK AuthCapture (iterations = 1) err = 0\nTASK AuthError (iterations = 0) err = 0\nTASK PurchaseMultipleRefunds (iterations = 0) err = 0\nTASK Credit (iterations = 0) err = 0\nTASK AuthMultiCapture (iterations = 0) err = 0\n\nOperations:\nget:/1.0/kb/test/clock:                    avg = 135.00           min = 135.00           max = 135.00           tp90 = 135.00           std = 0.00            \npost:/1.0/kb/accounts:                     avg = 18032.00         min = 18032.00         max = 18032.00         tp90 = 18032.00         std = 0.00            \nget:/1.0/kb/accounts/uuid:                 avg = 1544.00          min = 1544.00          max = 1544.00          tp90 = 1544.00          std = 0.00            \npost:/1.0/kb/accounts/uuid/paymentMethods: avg = 29391.00         min = 29391.00         max = 29391.00         tp90 = 29391.00         std = 0.00            \nget:/1.0/kb/paymentMethods/uuid:           avg = 2429.00          min = 2429.00          max = 2429.00          tp90 = 2429.00          std = 0.00            \npost:/1.0/kb/accounts/uuid/payments:       avg = 50477.00         min = 50477.00         max = 50477.00         tp90 = 50477.00         std = 0.00            \nget:/1.0/kb/payments/uuid:                 avg = 2843.00          min = 2594.00          max = 3092.00          tp90 = 3092.00          std = 249.00          \npost:/1.0/kb/payments/uuid:                avg = 85739.00         min = 85739.00         max = 85739.00         tp90 = 85739.00         std = 0.00  \n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillbill%2Fkillbill-integration-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkillbill%2Fkillbill-integration-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillbill%2Fkillbill-integration-tests/lists"}