planner/core: migrate test-infra to testify for 'planner/core/optimizer_test.go' (#31969)
planner/core: migrate test-infra to testify for 'planner/core/optimizer_test.go' (#31969)

close pingcap/tidb#28402
pingcap/tidb,kyle-wang/tidb,ngaut/tidb,c4pt0r/tidb,kyle-wang/tidb,ngaut/tidb,c4pt0r/tidb,pingcap/tidb,c4pt0r/tidb,c4pt0r/tidb,kyle-wang/tidb,kyle-wang/tidb,pingcap/tidb,pingcap/tidb,c4pt0r/tidb,kyle-wang/tidb,ngaut/tidb,ngaut/tidb,pingcap/tidb,ngaut/tidb,pingcap/tidb,ngaut/tidb,c4pt0r/tidb,kyle-wang/tidb