Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/WizardXiao/ticdc into fix…
Browse files Browse the repository at this point in the history
…-diff-default-collation
  • Loading branch information
WizardXiao committed Dec 6, 2021
2 parents ef9a973 + 9388e0b commit 89113bf
Show file tree
Hide file tree
Showing 31 changed files with 92 additions and 88 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ticdc_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ jobs:
- name: Build Integration Framework
run: |
cd $GITHUB_WORKSPACE/integration
cd $GITHUB_WORKSPACE/tests/mq_protocol_tests
go build
- name: Run Integration Framework
timeout-minutes: 45
run: |
cd $GITHUB_WORKSPACE/integration
./integration -protocol=mysql
cd $GITHUB_WORKSPACE/tests/mq_protocol_tests
./mq_protocol_tests -protocol=mysql
- name: Try to dump container logs
if: ${{ failure() }}
Expand Down Expand Up @@ -120,14 +120,14 @@ jobs:
- name: Build Integration Framework
run: |
cd $GITHUB_WORKSPACE/integration
cd $GITHUB_WORKSPACE/tests/mq_protocol_tests
go build
- name: Run Integration Framework
timeout-minutes: 45
run: |
cd $GITHUB_WORKSPACE/integration
./integration -protocol=simple-mysql-checking-old-value
cd $GITHUB_WORKSPACE/tests/mq_protocol_tests
./mq_protocol_tests -protocol=simple-mysql-checking-old-value
- name: Try to dump container logs
if: ${{ failure() }}
Expand Down Expand Up @@ -182,14 +182,14 @@ jobs:
- name: Build Integration Framework
run: |
cd $GITHUB_WORKSPACE/integration
cd $GITHUB_WORKSPACE/tests/mq_protocol_tests
go build
- name: Run Integration Framework
timeout-minutes: 45
run: |
cd $GITHUB_WORKSPACE/integration
./integration -protocol=canalJson
cd $GITHUB_WORKSPACE/tests/mq_protocol_tests
./mq_protocol_tests -protocol=canalJson
- name: Try to dump container logs
if: ${{ failure() }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ticdc_integration_cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ jobs:
- name: Build Integration Framework
run: |
cd $GITHUB_WORKSPACE/integration
cd $GITHUB_WORKSPACE/tests/mq_protocol_tests
go build
- name: Run Integration Framework
timeout-minutes: 45
run: |
cd $GITHUB_WORKSPACE/integration
./integration -protocol=canal
cd $GITHUB_WORKSPACE/tests/mq_protocol_tests
./mq_protocol_tests -protocol=canal
- name: Try to dump container logs
if: ${{ failure() }}
Expand Down Expand Up @@ -110,14 +110,14 @@ jobs:
- name: Build Integration Framework
run: |
cd $GITHUB_WORKSPACE/integration
cd $GITHUB_WORKSPACE/tests/mq_protocol_tests
go build
- name: Run Integration Framework
timeout-minutes: 45
run: |
cd $GITHUB_WORKSPACE/integration
./integration
cd $GITHUB_WORKSPACE/tests/mq_protocol_tests
./mq_protocol_tests
- name: Try to dump container logs
if: ${{ failure() }}
Expand Down
10 changes: 7 additions & 3 deletions integration/README.md → tests/mq_protocol_tests/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Integration Framework

## Introduction
The **Integration Framework** is designed to provide a flexible way for contributors to write integration tests for new sinks or MQ protocols. The core of the framework is stored in `{ticdc_root}/integration/framework`, and test cases should be stored in `{ticdc_root}/integration`. Currently, although the Framework is still under active development, it is capable of helping test Avro support and it is the only officially supported way for developers to run integration tests with Kafka connect.
The **Integration Framework** is designed to provide a flexible way for contributors to write integration tests for new
sinks or MQ protocols. The core of the framework is stored in `{ticdc_root}/tests/mq_protocol_tests/framework`, and test
cases should be stored in `{ticdc_root}/tests/mq_protocol_tests/cases`. Currently, although the Framework is still under
active development, it is capable of helping test Avro support and it is the only officially supported way for
developers to run integration tests with Kafka connect.

## Quick Start
To create a test case, you need to:
Expand All @@ -23,7 +27,7 @@ For the time being, if you would like to write a test case for Avro and Canal, i

Example:
```go
// tests/base_mycase.go
// cases/base_mycase.go
type MyCase struct {
framework.Task
}
Expand Down Expand Up @@ -71,7 +75,7 @@ func (c *MyCase) Run(ctx *framework.TaskContext) error {
}


// tests/integration.go
// main.go
func main() {
task := &canal.SingleTableTask{TableName: "test"}
testCases := []framework.Task{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package tests
package cases

import (
"fmt"
"math/rand"

"github.com/pingcap/errors"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
)

// AlterCase is base impl of test case for alter operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package tests
package cases

import (
"github.com/pingcap/errors"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
)

// CompositePKeyCase is base impl of test case for composite primary keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package tests
package cases

import (
"errors"
"log"
"time"

"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/integration/framework/avro"
"github.com/pingcap/ticdc/integration/framework/canal"
"github.com/pingcap/ticdc/integration/framework/mysql"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework/avro"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework/canal"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework/mysql"
)

// DateTimeCase is base impl of test case for different types data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package tests
package cases

import (
"errors"

"github.com/pingcap/log"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"go.uber.org/zap"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package tests
package cases

import (
"errors"
"math"
"time"

"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/integration/framework/avro"
"github.com/pingcap/ticdc/integration/framework/canal"
"github.com/pingcap/ticdc/integration/framework/mysql"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework/avro"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework/canal"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework/mysql"
)

// ManyTypesCase is base impl of test case for different types data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package tests
package cases

import (
"github.com/pingcap/errors"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
)

// SimpleCase is base impl of simple test case
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package tests
package cases

import (
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
)

// UnsignedCase is base impl of test case for unsigned int type data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/integralist/go-findroot/find"
"github.com/pingcap/errors"
"github.com/pingcap/log"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"go.uber.org/zap"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/pingcap/log"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"github.com/stretchr/testify/require"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/pingcap/errors"
"github.com/pingcap/log"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"go.uber.org/zap"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"database/sql"
"testing"

"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"github.com/stretchr/testify/require"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/integralist/go-findroot/find"
"github.com/pingcap/errors"
"github.com/pingcap/log"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"go.uber.org/zap"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/pingcap/log"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"github.com/stretchr/testify/require"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"time"

"github.com/pingcap/log"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"database/sql"
"testing"

"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"github.com/stretchr/testify/require"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/integralist/go-findroot/find"
"github.com/pingcap/errors"
"github.com/pingcap/log"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"go.uber.org/zap"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/pingcap/log"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"github.com/stretchr/testify/require"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"time"

"github.com/pingcap/log"
"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"database/sql"
"testing"

"github.com/pingcap/ticdc/integration/framework"
"github.com/pingcap/ticdc/tests/mq_protocol_tests/framework"
"github.com/stretchr/testify/require"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 89113bf

Please sign in to comment.