Skip to content

Commit

Permalink
accelarate build
Browse files Browse the repository at this point in the history
Signed-off-by: husharp <[email protected]>
  • Loading branch information
HuSharp committed Jun 28, 2024
1 parent 28e34cb commit 1743aab
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/pd-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,25 @@ jobs:
- worker_id: 1
name: 'Unit Test(core)'
- worker_id: 2
name: 'Unit Test(others)'
name: 'Unit Test(schedule)'
- worker_id: 3
name: 'Tests(core)'
name: 'Unit Test(others)'
- worker_id: 4
name: 'Tests(others)'
name: 'Tests(core)'
- worker_id: 5
name: 'Tools Test'
name: 'Tests(others)'
- worker_id: 6
name: 'Client Integration Test'
name: 'Tools Test'
- worker_id: 7
name: 'TSO Integration Test'
name: 'Client Integration Test'
- worker_id: 8
name: 'MicroService Integration(Core)'
name: 'TSO Integration Test'
- worker_id: 9
name: 'MicroService Integration(Core)'
- worker_id: 10
name: 'MicroService Integration(TSO)'
outputs:
job-total: 9
job-total: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
24 changes: 14 additions & 10 deletions scripts/ci-subtask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,44 @@ integrations_dir=$(pwd)/tests/integrations

case $1 in
1)
# unit tests ignore `tests`, `server`, `schedule` and `utils/etcdutil`
./bin/pd-ut run --ignore tests,server,pkg/schedule,utils/etcdutil --race --coverprofile $ROOT_PATH_COV --junitfile $ROOT_PATH_JUNITFILE || exit 1
# unit tests ignore `tests`, `server`, `schedule` and `utils`
./bin/pd-ut run --ignore tests,server,pkg/schedule,pkg/utils --race --coverprofile $ROOT_PATH_COV --junitfile $ROOT_PATH_JUNITFILE || exit 1
;;
2)
# unit tests only in `server`, `schedule` and `utils/etcdutil` without `tests`
./bin/pd-ut run server,schedule,utils/etcdutil --ignore tests --race --coverprofile $ROOT_PATH_COV --junitfile $ROOT_PATH_JUNITFILE || exit 1
# unit tests only in `schedule` without `tests`
./bin/pd-ut run schedule --ignore tests --race --coverprofile $ROOT_PATH_COV --junitfile $ROOT_PATH_JUNITFILE || exit 1
;;
3)
# unit tests only in `server` and `utils` without `tests`
./bin/pd-ut run server,utils --ignore tests --race --coverprofile $ROOT_PATH_COV --junitfile $ROOT_PATH_JUNITFILE || exit 1
;;
4)
# tests only in `tests` without `server/api, server/cluster and `server/config`
./bin/pd-ut run tests --ignore tests/server/api,tests/server/cluster,tests/server/config --race --coverprofile $ROOT_PATH_COV --junitfile $ROOT_PATH_JUNITFILE || exit 1
;;
4)
5)
# tests only in `server/api, server/cluster and `server/config` in `tests`
./bin/pd-ut run tests/server/api,tests/server/cluster,tests/server/config --race --coverprofile $ROOT_PATH_COV --junitfile $ROOT_PATH_JUNITFILE || exit 1
;;
5)
6)
# tools tests
cd ./tools && make ci-test-job && cat covprofile >> $ROOT_PATH_COV || exit 1
;;
6)
7)
# integration test client
./bin/pd-ut it run client --race --coverprofile $ROOT_PATH_COV --junitfile $ROOT_PATH_JUNITFILE || exit 1
# client tests
cd ./client && make ci-test-job && cat covprofile >> $ROOT_PATH_COV || exit 1
;;
7)
8)
# integration test tso
./bin/pd-ut it run tso --race --ignore mcs/tso --coverprofile $ROOT_PATH_COV --junitfile $ROOT_PATH_JUNITFILE || exit 1
;;
8)
9)
# integration test mcs without mcs/tso
./bin/pd-ut it run mcs --race --ignore mcs/tso --coverprofile $ROOT_PATH_COV --junitfile $ROOT_PATH_JUNITFILE || exit 1
;;
9)
10)
# integration test mcs/tso
./bin/pd-ut it run mcs/tso --race --coverprofile $ROOT_PATH_COV --junitfile $ROOT_PATH_JUNITFILE || exit 1
;;
Expand Down

0 comments on commit 1743aab

Please sign in to comment.