Skip to content

Commit

Permalink
test(engine): handle integration test logs properly (#6672)
Browse files Browse the repository at this point in the history
ref #6255
  • Loading branch information
CharlesCheung96 authored Aug 24, 2022
1 parent c7f2901 commit 84a854f
Show file tree
Hide file tree
Showing 25 changed files with 214 additions and 162 deletions.
56 changes: 4 additions & 52 deletions .github/workflows/dataflow_engine_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,12 @@ jobs:
cd $GITHUB_WORKSPACE/engine/test/e2e
go test -count=1 -v -run=TestSubmitTest
- name: Dump docker container logs on failure
if: ${{ failure() }}
uses: jwalton/gh-docker-logs@v2
with:
tail: '100'

- name: Collect docker logs on failure
if: ${{ failure() }}
uses: jwalton/gh-docker-logs@v2
with:
dest: 'logs'

- name: Upload logs to GitHub
if: ${{ failure() }}
uses: actions/upload-artifact@master
with:
name: basic-workflow-logs
path: logs/*
path: /tmp/tiflow_engine_test/*log

Node-failure-workflow:
runs-on: ubuntu-latest
Expand All @@ -78,24 +66,12 @@ jobs:
cd $GITHUB_WORKSPACE/engine/test/e2e
go test -count=1 -v -run=TestNodeFailure
- name: Dump docker container logs on failure
if: ${{ failure() }}
uses: jwalton/gh-docker-logs@v2
with:
tail: '100'

- name: Collect docker logs on failure
if: ${{ failure() }}
uses: jwalton/gh-docker-logs@v2
with:
dest: 'logs'

- name: Upload logs to GitHub
if: ${{ failure() }}
uses: actions/upload-artifact@master
with:
name: node-failure-workflow-logs
path: logs/*
path: /tmp/tiflow_engine_test/*log

Worker-error-workflow:
runs-on: ubuntu-latest
Expand All @@ -118,24 +94,12 @@ jobs:
cd $GITHUB_WORKSPACE/engine/test/e2e
go test -count=1 -v -run=TestWorkerExit
- name: Dump docker container logs on failure
if: ${{ failure() }}
uses: jwalton/gh-docker-logs@v2
with:
tail: '100'

- name: Collect docker logs on failure
if: ${{ failure() }}
uses: jwalton/gh-docker-logs@v2
with:
dest: 'logs'

- name: Upload logs to GitHub
if: ${{ failure() }}
uses: actions/upload-artifact@master
with:
name: worker-errror-workflow-logs
path: logs/*
path: /tmp/tiflow_engine_test/*log

DM-workflow:
runs-on: ubuntu-latest
Expand All @@ -161,21 +125,9 @@ jobs:
cd $GITHUB_WORKSPACE/engine/test/e2e
go test -count=1 -v -run=TestDMJob
- name: Dump docker container logs on failure
if: ${{ failure() }}
uses: jwalton/gh-docker-logs@v2
with:
tail: '100'

- name: Collect docker logs on failure
if: ${{ failure() }}
uses: jwalton/gh-docker-logs@v2
with:
dest: 'logs'

- name: Upload logs to GitHub
if: ${{ failure() }}
uses: actions/upload-artifact@master
with:
name: dm-workflow-logs
path: logs/*
path: /tmp/tiflow_engine_test/*log
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,16 @@ engine_image_from_local:
engine_unit_test: check_failpoint_ctl
$(call run_engine_unit_test,$(ENGINE_PACKAGES))

engine_integration_test: bin/sync_diff_inspector
@which docker || (echo "docker not found in ${PATH}"; exit 1)
engine_integration_test: check_third_party_binary_for_engine
./engine/test/integration_tests/run.sh "$(CASE)" "$(START_AT)"

check_third_party_binary_for_engine:
@which bash || (echo "bash not found in ${PATH}"; exit 1)
@which docker || (echo "docker not found in ${PATH}"; exit 1)
@which go || (echo "go not found in ${PATH}"; exit 1)
@which mysql || (echo "mysql not found in ${PATH}"; exit 1)
@which jq || (echo "jq not found in ${PATH}"; exit 1)

bin/sync_diff_inspector:
./scripts/download-sync-diff.sh

Expand Down
2 changes: 1 addition & 1 deletion cmd/tiflow-demoserver/kvdatamake.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ START:
fmt.Printf("starting demo, dir %s addr %s\n", demoDir, demoAddress)
err := logutil.InitLogger(&logutil.Config{
Level: "info",
// File: demoDir + "demo.log",
File: demoDir + "/demo.log",
})
if err != nil {
fmt.Printf("err: %v", err)
Expand Down
6 changes: 6 additions & 0 deletions deployments/engine/docker-compose/1m1e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ version: "2.3"
services:
server-master:
image: dataflow:test
container_name: server-master-0
volumes:
- ./config/master.toml:/config.toml
- /tmp/tiflow_engine_test:/log
command:
- "/tiflow"
- "master"
- "--config=/config.toml"
- "--log-level=debug"
- "--addr=0.0.0.0:10240"
- "--advertise-addr=server-master:10240"
- "--log-file=/log/server-master-0.log"
ports:
- "10240:10240"
depends_on:
Expand All @@ -20,8 +23,10 @@ services:
condition: service_healthy
server-executor:
image: dataflow:test
container_name: server-executor-0
volumes:
- ./config/executor.toml:/config.toml
- /tmp/tiflow_engine_test:/log
command:
- "/tiflow"
- "executor"
Expand All @@ -30,6 +35,7 @@ services:
- "--join=server-master:10240"
- "--addr=0.0.0.0:10241"
- "--advertise-addr=server-executor:10241"
- "--log-file=/log/server-executor-0.log"
ports:
- "10241:10241"
depends_on:
Expand Down
12 changes: 12 additions & 0 deletions deployments/engine/docker-compose/1m3e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ version: "2.3"
services:
server-master:
image: dataflow:test
container_name: server-master-0
volumes:
- ./config/master.toml:/config.toml
- /tmp/tiflow_engine_test:/log
command:
- "/tiflow"
- "master"
- "--config=/config.toml"
- "--addr=0.0.0.0:10240"
- "--advertise-addr=server-master:10240"
- "--log-file=/log/server-master-0.log"
ports:
- "10240:10240"
depends_on:
Expand All @@ -19,47 +22,56 @@ services:
condition: service_healthy
server-executor-0:
image: dataflow:test
container_name: server-executor-0
volumes:
- ./config/executor.toml:/config.toml
- /tmp/tiflow_engine_test:/log
command:
- "/tiflow"
- "executor"
- "--config=/config.toml"
- "--join=server-master:10240"
- "--addr=0.0.0.0:10241"
- "--advertise-addr=server-executor-0:10241"
- "--log-file=/log/server-executor-0.log"
depends_on:
- "server-master"
restart: "on-failure"
extra_hosts:
- "host.docker.internal:host-gateway"
server-executor-1:
image: dataflow:test
container_name: server-executor-1
volumes:
- ./config/executor.toml:/config.toml
- /tmp/tiflow_engine_test:/log
command:
- "/tiflow"
- "executor"
- "--config=/config.toml"
- "--join=server-master:10240"
- "--addr=0.0.0.0:10241"
- "--advertise-addr=server-executor-1:10241"
- "--log-file=/log/server-executor-1.log"
depends_on:
- "server-master"
restart: "on-failure"
extra_hosts:
- "host.docker.internal:host-gateway"
server-executor-2:
image: dataflow:test
container_name: server-executor-2
volumes:
- ./config/executor.toml:/config.toml
- /tmp/tiflow_engine_test:/log
command:
- "/tiflow"
- "executor"
- "--config=/config.toml"
- "--join=server-master:10240"
- "--addr=0.0.0.0:10241"
- "--advertise-addr=server-executor-2:10241"
- "--log-file=/log/server-executor-2.log"
depends_on:
- "server-master"
restart: "on-failure"
Expand Down
29 changes: 21 additions & 8 deletions deployments/engine/docker-compose/3m3e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,75 @@ version: "2.3"
services:
server-master-0:
image: dataflow:test
container_name: 3m3e-server-master-0
container_name: server-master-0
ports:
- "10245:10240"
volumes:
- ./config/master.toml:/config.toml
- /tmp/tiflow_engine_test:/log
command:
- "/tiflow"
- "master"
- "--config=/config.toml"
- "--log-level=debug"
- "--addr=0.0.0.0:10240"
- "--advertise-addr=server-master-0:10240"
- "--log-file=/log/server-master-0.log"
depends_on:
"etcd-standalone":
condition: service_started
"mysql-standalone":
condition: service_healthy
server-master-1:
image: dataflow:test
container_name: 3m3e-server-master-1
container_name: server-master-1
ports:
- "10246:10240"
volumes:
- ./config/master.toml:/config.toml
- /tmp/tiflow_engine_test:/log
command:
- "/tiflow"
- "master"
- "--config=/config.toml"
- "--log-level=debug"
- "--addr=0.0.0.0:10240"
- "--advertise-addr=server-master-1:10240"
- "--log-file=/log/server-master-1.log"
depends_on:
"etcd-standalone":
condition: service_started
"mysql-standalone":
condition: service_healthy
server-master-2:
image: dataflow:test
container_name: 3m3e-server-master-2
container_name: server-master-2
ports:
- "10247:10240"
volumes:
- ./config/master.toml:/config.toml
- /tmp/tiflow_engine_test:/log
command:
- "/tiflow"
- "master"
- "--config=/config.toml"
- "--log-level=debug"
- "--addr=0.0.0.0:10240"
- "--advertise-addr=server-master-2:10240"
- "--log-file=/log/server-master-2.log"
depends_on:
"etcd-standalone":
condition: service_started
"mysql-standalone":
condition: service_healthy
server-executor-0:
image: dataflow:test
container_name: 3m3e-server-executor-0
container_name: server-executor-0
ports:
- "11241:10241"
volumes:
- ./config/executor.toml:/config.toml
- /tmp/tiflow_engine_test:/log
command:
- "/tiflow"
- "executor"
Expand All @@ -72,6 +79,7 @@ services:
- "--join=server-master-0:10240,server-master-1:10240,server-master-2:10240"
- "--addr=0.0.0.0:10241"
- "--advertise-addr=server-executor-0:10241"
- "--log-file=/log/server-executor-0.log"
depends_on:
- "server-master-0"
- "server-master-2"
Expand All @@ -80,11 +88,12 @@ services:
- "host.docker.internal:host-gateway"
server-executor-1:
image: dataflow:test
container_name: 3m3e-server-executor-1
container_name: server-executor-1
ports:
- "11242:10241"
volumes:
- ./config/executor.toml:/config.toml
- /tmp/tiflow_engine_test:/log
command:
- "/tiflow"
- "executor"
Expand All @@ -93,6 +102,7 @@ services:
- "--join=server-master-0:10240,server-master-1:10240,server-master-2:10240"
- "--addr=0.0.0.0:10241"
- "--advertise-addr=server-executor-1:10241"
- "--log-file=/log/server-executor-1.log"
depends_on:
- "server-master-0"
- "server-master-2"
Expand All @@ -101,11 +111,12 @@ services:
- "host.docker.internal:host-gateway"
server-executor-2:
image: dataflow:test
container_name: 3m3e-server-executor-2
container_name: server-executor-2
ports:
- "11243:10241"
volumes:
- ./config/executor.toml:/config.toml
- /tmp/tiflow_engine_test:/log
command:
- "/tiflow"
- "executor"
Expand All @@ -114,6 +125,7 @@ services:
- "--join=server-master-0:10240,server-master-1:10240,server-master-2:10240"
- "--addr=0.0.0.0:10241"
- "--advertise-addr=server-executor-2:10241"
- "--log-file=/log/server-executor-2.log"
depends_on:
- "server-master-0"
- "server-master-2"
Expand All @@ -122,7 +134,7 @@ services:
- "host.docker.internal:host-gateway"
etcd-standalone:
image: quay.io/coreos/etcd
container_name: 3m3e-etcd-standalone
container_name: etcd-standalone
command:
- "etcd"
- "--listen-client-urls=http://0.0.0.0:2379"
Expand All @@ -131,11 +143,12 @@ services:
- "12479:2379"
mysql-standalone:
image: mysql:5.7
container_name: 3m3e-mysql-standalone
container_name: mysql-standalone
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
volumes:
- './config/mysql_meta.cnf:/etc/my.cnf'
- /tmp/tiflow_engine_test:/log
ports:
- "3336:3306"
healthcheck:
Expand Down
Loading

0 comments on commit 84a854f

Please sign in to comment.