Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression: Add test framework for vectorized expression evaluation functions #11963

Merged
merged 20 commits into from Sep 3, 2019

Conversation

@Reminiscent
Copy link
Contributor

commented Sep 1, 2019

What problem does this PR solve?

Add an automated test framework for vectorized expression evaluation functions.

What is changed and how it works?

  1. Add function genVecBuiltinFuncBenchCase to generate builtinFunc for the next unit test and benchmark test
  2. Add function TestVectorizedBuiltinFunc for unit test for builtin Function expression.
  3. Add function BenchmarkVectorizedBuiltinFunc for benchmark test for builtin Function expression.

Check List

Tests

  • Unit test
Reminiscent and others added 2 commits Sep 1, 2019
@codecov

This comment has been minimized.

Copy link

commented Sep 2, 2019

Codecov Report

Merging #11963 into master will decrease coverage by 0.2933%.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             master     #11963        +/-   ##
================================================
- Coverage   81.6209%   81.3275%   -0.2934%     
================================================
  Files           445        445                
  Lines         96773      95365      -1408     
================================================
- Hits          78987      77558      -1429     
- Misses        12248      12283        +35     
+ Partials       5538       5524        -14
qw4990 added 5 commits Sep 2, 2019

@qw4990 qw4990 requested a review from SunRunAway Sep 2, 2019

@qw4990 qw4990 removed their request for review Sep 2, 2019

@@ -20,3 +20,5 @@ require (
gopkg.in/yaml.v2 v2.2.2 // indirect
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3
)

replace golang.org/x/tools => golang.org/x/tools v0.0.0-20190829051458-42f498d34c4d

This comment has been minimized.

Copy link
@zz-jason

zz-jason Sep 2, 2019

Member

why not directly update the version of golang.org/x/tools?

This comment has been minimized.

Copy link
@qw4990

qw4990 Sep 3, 2019

Contributor

updated, PTAL.

expression/bench_test.go Outdated Show resolved Hide resolved
}

func genVecExprBenchCase(ctx sessionctx.Context, testCase vecExprBenchCase) (Expression, *chunk.Chunk, *chunk.Chunk) {
func genVecExprBenchCase(ctx sessionctx.Context, funcName string, testCase vecExprBenchCase) (Expression, *chunk.Chunk, *chunk.Chunk) {

This comment has been minimized.

Copy link
@SunRunAway

SunRunAway Sep 3, 2019

Member

Suggest naming the return value explicitly in this case, so that we can peek to know what is returning.

func genVecExprBenchCase(ctx sessionctx.Context, funcName string, testCase vecExprBenchCase) (expr Expression, input, output *chunk.Chunk) {

This comment has been minimized.

Copy link
@qw4990

qw4990 Sep 3, 2019

Contributor

updated.

@@ -255,58 +333,375 @@ func genVecExprBenchCase(ctx sessionctx.Context, testCase vecExprBenchCase) (Exp
return expr, input, output
}

func TestVectorizedExpression(t *testing.T) {
func TestVectorizedEvalOneVec(t *testing.T) {

This comment has been minimized.

Copy link
@SunRunAway

SunRunAway Sep 3, 2019

Member

tidb uses check framework to do all unit tests that would probably be better to keep unifying.

This comment has been minimized.

Copy link
@qw4990

qw4990 Sep 3, 2019

Contributor

updated.

@SunRunAway
Copy link
Member

left a comment

LGTM

@zz-jason
Copy link
Member

left a comment

LGTM

@sre-bot

This comment has been minimized.

Copy link

commented Sep 3, 2019

/run-all-tests

@sre-bot

This comment has been minimized.

Copy link

commented Sep 3, 2019

@Reminiscent merge failed.

@qw4990

This comment has been minimized.

Copy link
Contributor

commented Sep 3, 2019

/run-unit-test

@qw4990 qw4990 merged commit e56c6db into pingcap:master Sep 3, 2019

13 checks passed

idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/build_check_race Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev_2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/common-test job succeeded
Details
idc-jenkins-ci-tidb/integration-common-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-compatibility-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-ddl-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/mybatis-test job succeeded
Details
idc-jenkins-ci-tidb/sqllogic-test-1 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/sqllogic-test-2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details
jingyugao added a commit to jingyugao/tidb that referenced this pull request Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.