From 1743aabd8dc7f43bbcc7d96144b8a64b7651a1a0 Mon Sep 17 00:00:00 2001 From: husharp Date: Fri, 28 Jun 2024 08:33:58 +0800 Subject: [PATCH] accelarate build Signed-off-by: husharp --- .github/workflows/pd-tests.yaml | 18 ++++++++++-------- scripts/ci-subtask.sh | 24 ++++++++++++++---------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pd-tests.yaml b/.github/workflows/pd-tests.yaml index 928ef9d26631..e89fc860344c 100644 --- a/.github/workflows/pd-tests.yaml +++ b/.github/workflows/pd-tests.yaml @@ -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 diff --git a/scripts/ci-subtask.sh b/scripts/ci-subtask.sh index 2567be2d4ea9..526b9d0e252c 100755 --- a/scripts/ci-subtask.sh +++ b/scripts/ci-subtask.sh @@ -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 ;;