core: fix datarace in MergeLabels (#7537) #21856
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PD Tests | |
on: | |
push: | |
branches: | |
- master | |
- release-4.0 | |
- release-5.* | |
pull_request: | |
branches: | |
- master | |
- release-4.0 | |
- release-5.* | |
jobs: | |
chunks: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
worker_id: [1, 2, 3, 4] | |
outputs: | |
job-total: ${{ strategy.job-total }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.16 | |
- name: Dispatch Packages | |
id: packages-units | |
env: | |
WORKER_ID: ${{ matrix.worker_id }} | |
# github.com/tikv/pd/tests/server/tso is the integration test of TSO, which will take a long time, | |
# will be run independently in the TSO Function Test. | |
run: | | |
go list ./... | grep -v -E "github.com/tikv/pd/server/api|github.com/tikv/pd/tests/client|github.com/tikv/pd/tests/server/tso" > packages.list | |
total=$(expr ${{ strategy.job-total }} - 1) | |
echo "Dispatched ${total} normal chunks" | |
split packages.list -n r/${total} packages_unit_ -a 1 --numeric-suffixes=1 | |
echo "Dispatched 2 special task to the last chunk (the special tests take a long time)" | |
echo github.com/tikv/pd/server/api > packages_unit_${{ strategy.job-total }} | |
echo github.com/tikv/pd/tests/client >> packages_unit_${{ strategy.job-total }} | |
packages="{$(cat packages_unit_${WORKER_ID} |tr "\n" ",")}" | |
echo "This worker will test the chunk - ${packages}" | |
echo "::set-output name=list::${packages}" | |
- name: Make Test | |
env: | |
WORKER_ID: ${{ matrix.worker_id }} | |
run: | | |
make test-with-cover TEST_PKGS="${{ steps.packages-units.outputs.list }}" | |
mv covprofile covprofile_$WORKER_ID | |
sed -i "/failpoint_binding/d" covprofile_$WORKER_ID | |
- name: Upload coverage result ${{ matrix.worker_id }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cover-reports-${{ matrix.worker_id }} | |
path: covprofile_${{ matrix.worker_id }} | |
report-coverage: | |
needs: chunks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download chunk report | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: cover-reports-* | |
merge-multiple: true | |
- name: Merge | |
env: | |
TOTAL_JOBS: ${{needs.chunks.outputs.job-total}} | |
run: | | |
echo ${TOTAL_JOBS} | |
for i in $(seq 1 $TOTAL_JOBS); do cat covprofile_$i >> covprofile; done | |
cat covprofile | |
- name: Send coverage | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV }} | |
file: ./covprofile | |
flags: unittests | |
name: codecov-umbrella |