{"id":13392514,"url":"https://github.com/Qihoo360/Atlas","last_synced_at":"2025-03-13T18:31:51.868Z","repository":{"id":12608941,"uuid":"15279980","full_name":"Qihoo360/Atlas","owner":"Qihoo360","description":"A high-performance and stable proxy for MySQL, it is developed by Qihoo's DBA and infrastructure team","archived":false,"fork":false,"pushed_at":"2019-01-04T09:14:10.000Z","size":2284,"stargazers_count":4651,"open_issues_count":176,"forks_count":1151,"subscribers_count":531,"default_branch":"master","last_synced_at":"2025-03-09T01:57:14.272Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Qihoo360.png","metadata":{"files":{"readme":"README.TESTS","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-18T10:14:57.000Z","updated_at":"2025-03-05T08:01:07.000Z","dependencies_parsed_at":"2022-07-16T13:30:31.628Z","dependency_job_id":null,"html_url":"https://github.com/Qihoo360/Atlas","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qihoo360%2FAtlas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qihoo360%2FAtlas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qihoo360%2FAtlas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qihoo360%2FAtlas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Qihoo360","download_url":"https://codeload.github.com/Qihoo360/Atlas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243459110,"owners_count":20294340,"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":[],"created_at":"2024-07-30T17:00:25.560Z","updated_at":"2025-03-13T18:31:51.269Z","avatar_url":"https://github.com/Qihoo360.png","language":"C","funding_links":[],"categories":["数据库中间件","C","数据库管理系统","数据库中间件( DB Proxy )"],"sub_categories":["Editor","网络服务_其他"],"readme":"TESTING OVERVIEW\n----------------\n\nThe normal test suite is under ./tests/suite/base\nRun it with \n\n$ make check\n\n\nOr if you want to run it manually, do\n\n$ lua tests/run-tests.lua tests/suite/base\n\nCREATING A NEW TEST CASE\n------------------------\nA test case in this testing environment is made of the following components\n\n./t/test_name.test\n./t/test_name.lua      (optional)\n./t/test_name.options  (optional)  \n./r/test_name.result\n\nThe basics are like in the server test suite.\n\na ./t/test_name.test contains SQL statements and mysqltest commands as defined in the manual\nhttp://dev.mysql.com/doc/mysqltest/en/mysqltest-commands.html\n\nThe corresponding ./r/test_name.result contains the output of the statements above, as produced by mysqltest.\n\nIn addition to the above basics, when preparing a test case for MySSQL Proxy, you can add the following ones:\n\n./t/test_name.lua\nThis is a Lua script that gets loaded to MySQL Proxy before the test starts.\nIf no such test is defined, the Proxy starts with an empty script.\n\n./t/test_name.options\nThis file contains Lua instructions that are executed before the test.\nFor the user's convenience, there are a few functions that you can call from this file\n\n   * start_proxy(proxy_name, options_table)\n     starts a proxy instance, with given parameters. The proxy name is\n     used to retrieve information about this instance, to use the proxy\n     or to remove it\n     example:\n     start_proxy('my_name', \n       {\n        [\"proxy-backend-addresses\"] = PROXY_HOST .. ':' .. PROXY_MASTER_PORT ,\n        [\"proxy-read-only-backend-addresses\"] = PROXY_HOST .. ':' .. PROXY_SLAVE_PORT ,\n        [\"proxy-address\"]           = PROXY_HOST .. ':' .. PROXY_PORT ,\n        [\"admin-address\"]           = PROXY_HOST .. ':' .. ADMIN_PORT ,\n        [\"pid-file\"]                = PROXY_PIDFILE,\n        [\"proxy-lua-script\"]        = 'my_name.lua',\n        })\n    \n    As illustrated, there are several global variables that can be referenced within this\n    options file:\n    PROXY_HOST\n    PROXY_PORT\n    ADMIN_PORT\n    (TODO: complete the list)\n\n   * stop_proxy()\n     removes all proxy instances created with start_proxy()\n\n   * simulate_replication([master_options,slave_options])\n     starts two instances of the proxy, both pointing to the same\n     backend server. You can connect to a real replication, by\n     supplying appropriate options\n\n   * chain_proxy(first_lua_script, second_lua_script [, use_replication])\n     starts two proxy instances, the first one pointing to the backend\n     server, the second one pointing to the first instance.\n     If use_replication is given (boolean), then a master backend is used\n     instead of a real backend. If no master/slave replication is\n     available, simulate_replication() is called\n\n   * sql_execute(queries, proxy_name)\n     sends one or more queries to a given proxy. ('queries' can be either\n     a string or an array of strings)\n     If no proxy name is provided, the query is sent to the backend server.\n\n\n\n\nSKIPPING TESTS\n--------------\n\nIf you want to skip one or more tests, edit the file suite_name/tests_to_skip.lua\n\n\nCREATING A NEW TEST SUITE\n-------------------------\n\nThe Proxy test suite follows the same principles used by the server test suite.\nThere is a directory (usually ./t) containing .test scripts, with the \ninstructions to run. And there is another directory (./r) containing the\nexpected results. For each .test file in ./t, there must be a corresponding \n.tesult file in ./r\nFor more information on the test framework, see the manual.\nhttp://dev.mysql.com/doc/mysqltest/en/index.html\n\nTo run your test suite, create a directory under ./trunk/tests/suite, add two \nsubdirectories /t and /r, and then use the above mentioned command.\nFor example:\n \n$ mkdir tests/suite/myapp\n$ mkdir tests/suite/myapp/t\n$ mkdir tests/suite/myapp/r\n\n# add test and result files under t and r\n\n$ lua tests/run-tests.lua tests/suite/myapp\n\nLIBRARY PATHS\n-------------\nThe test suite uses the following paths to search for Lua libraries when \na 'require' statement is issued. Each path is associated to an environment \nvariable:\n\nThis directory contains Lua libraries\n  variable       default                   description\n  -------------- ------------------------- -----------------------\n  LUA_LDIR       /usr/share/lua/5.1/?.lua  server wide Lua libraries\n  LUA_PATH       /usr/local/share/?.lua    MySQL Proxy Lua libraries\n  LUA_USER_PATH  ./trunk/lib/?.lua         user defined libraries\n\nIn addition to the above paths, the current suite is searched for\nlibraries as well. \n    suite_name ..  '/t/?.lua'  \n\nTROUBLESHOOTING\n---------------\n\nIf Lua complains about missing the lfs library, prepend the LUA_CPATH variable to the actual command:\n$ LUA_CPATH='tests/.libs/?.so' lua tests/run-tests.lua tests/suite/base\n\nIf the test suite complains about access denied, perhaps you need to provide a password. \nThe default user for the test suite is 'root', with no password.\nIf you want to run the tests with a different username and password, \nset the following environment variables\nMYSQL_USER\nMYSQL_PASSWORD\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FQihoo360%2FAtlas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FQihoo360%2FAtlas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FQihoo360%2FAtlas/lists"}