{"id":19331980,"url":"https://github.com/tikv/copr-test","last_synced_at":"2025-04-22T23:32:42.831Z","repository":{"id":40633238,"uuid":"215231163","full_name":"tikv/copr-test","owner":"tikv","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-13T11:44:27.000Z","size":4499,"stargazers_count":9,"open_issues_count":27,"forks_count":39,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-05-13T12:55:44.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tikv.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-15T07:09:54.000Z","updated_at":"2024-05-13T11:44:33.000Z","dependencies_parsed_at":"2024-01-03T07:29:42.796Z","dependency_job_id":"2acd7740-5148-4ac8-8b26-2e1c75d7c609","html_url":"https://github.com/tikv/copr-test","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/tikv%2Fcopr-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikv%2Fcopr-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikv%2Fcopr-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tikv%2Fcopr-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tikv","download_url":"https://codeload.github.com/tikv/copr-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223906349,"owners_count":17223046,"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-11-10T02:43:21.103Z","updated_at":"2024-11-10T02:43:21.691Z","avatar_url":"https://github.com/tikv.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coprocessor Tests\n\nCopr-test is a collection of integration tests for the Coprocessor module of TiKV. Coprocessor\nexecutes TiDB push-down executors to improve performance.\n\n## Push Down Test\n\n`./push-down-test`\n\nCurrently we only have push-down-test to test the Coprocessor module. Push-down-test exists to\nmake sure that execution results are consistent between TiDB and Coprocessor. It works by\nexecuteing test cases on  a standalone TiDB (with mocktikv) and on a TiDB cluster (with TiKV\nCoprocessor) and comparing the two execution results.\n\nCurrently TiKV Coprocessor supports two execution models, the non-vectorized, traditional model and\nthe newer vectorized model. Requests that cannot be processed by the vectorized model will fallback\nto the traditional model. Thus push-down-test also makes sure that the two execution model produce\nsame results, by comparing the following three combinations:\n\n- TiDB\n- TiDB + TiKV (Non-Vectorized)\n- TiDB + TiKV (Vectorized)\n\n### Function Whitelist\n\nThe Coprocessor module does not support all functions of TiDB (and some are implemented but not\nfully tested), so that TiDB [whitelists](https://github.com/pingcap/tidb/blob/a090e6be2991bf85b18fcdb096f84d41f4f6bd85/expression/expr_to_pb.go#L303)\nthe functions that can be pushed down to TiKV Coprocessor. In push-down-test however, we use\n[failpoint] to control the whitelist. The whitelist can be found in `push-down-test/functions.txt`\nin this repository. This means that you can test whether or not a specific TiKV Coprocessor function\nimplementation produces identical results to TiDB by adding the function name into the\n`push-down-test/functions.txt` file, instead of modifying TiDB's source code. This is extremely\nuseful when we only want to add an implementation at TiKV side but not enabling the push down at\nTiDB side for now.\n\n### Test Cases\n\nWe have already added some test cases generated by [randgen] in the push-down-test. Feel free to\nadd new ones. Your test case should be placed in the `push-down-test/sql` directory and ends with\n`.sql` suffix. Subdirectories are also supported.\n\n### Run Tests Locally\n\nPush-down-test will be run on our CI platform for TiKV PR automatically. You can also run it locally\nin order to debug easier. Before that, make sure that you have set up an environment to successfully\nbuild [TiDB], [PD] and [TiKV].\n\nSample step:\n\n```sh\nmkdir my_workspace\ncd my_workspace\n\ngit clone --depth=1 https://github.com/pingcap/pd.git\ngit clone --depth=1 https://github.com/pingcap/tidb.git\ngit clone --depth=1 https://github.com/tikv/tikv.git\ngit clone https://github.com/tikv/copr-test.git\n\ncd pd\nmake\n\ncd ../tikv\nmake build  # This make take a while. Be patient.\n\ncd ../copr-test\nexport pd_bin=`realpath ../pd/bin/pd-server`\nexport tikv_bin=`realpath ../tikv/target/debug/tikv-server`\nexport tidb_src_dir=`realpath ../tidb`\n# Run all tests\nmake push-down-test\n\n# You can run other target like `push-down-without-vec`\n# which will start a `mysql` client to run `push-down-without-vec` only.\n# You can reproduce failed SQL more conveniently\nmake push-down-without-vec\n\n# If you want to clean the `push-down-test/build` directory and kill all the tidb/pd/tikv processes, run:\nmake clean\n```\n\nIf you want to filter some test cases:\n\n```sh\ninclude=1_arith_1.sql make push-down-test\nexclude=1_arith_1.sql make push-down-test\n```\n\n[failpoint]: https://github.com/pingcap/failpoint\n[randgen]: https://github.com/MariaDB/randgen\n[TiDB]: https://github.com/pingcap/community/blob/master/CONTRIBUTING.md#building-tidb-on-a-local-osshell-environment\n[PD]: https://github.com/pingcap/pd#build\n[TiKV]: https://github.com/tikv/tikv/blob/master/CONTRIBUTING.md#building-and-setting-up-a-development-workspace\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftikv%2Fcopr-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftikv%2Fcopr-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftikv%2Fcopr-test/lists"}