Skip to content

Commit

Permalink
Merge branch 'master' into case-I
Browse files Browse the repository at this point in the history
  • Loading branch information
hongyunyan authored Jan 3, 2025
2 parents 272fccd + 76c3a0b commit 4c82a72
Show file tree
Hide file tree
Showing 8 changed files with 331 additions and 201 deletions.
34 changes: 34 additions & 0 deletions .github/actions/upload-test-logs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Upload Test Logs'
description: 'Copy and upload test logs'

runs:
using: "composite"
steps:
- name: Copy logs to hack permission
if: always()
shell: bash
run: |
DIR=$(sudo find /tmp/tidb_cdc_test/ -type d -name 'cdc_data*' -exec dirname {} \; | tail -n 1)
echo "Found the last dir: $DIR"
[ -z "$DIR" ] && exit 0
CASE=$(basename $DIR)
mkdir -p ./logs/$CASE
cat $DIR/stdout.log || true
tail -n 10 $DIR/cdc.log || true
sudo cp -r -L $DIR/*.log ./logs/$CASE/ || true
sudo cp -r -L $DIR/sync_diff ./logs/$CASE/ || true
sudo chown -R runner ./logs
sudo tar -czvf ./logs.tar.gz ./logs
- name: Upload logs
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ inputs.log-name }}
path: |
./logs.tar.gz
inputs:
log-name:
description: 'Name of the log artifact'
required: true
70 changes: 17 additions & 53 deletions .github/workflows/integration_test_mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,12 @@ jobs:
run: |
export TICDC_NEWARCH=true && make integration_test CASE=changefeed_reconstruct
- name: Copy logs to hack permission
if: ${{ always() }}
run: |
DIR=$(sudo find /tmp/tidb_cdc_test/ -type d -name 'cdc_data' -exec dirname {} \;)
[ -z "$DIR" ] && exit 0
CASE=$(basename $DIR)
mkdir -p ./logs/$CASE
cat $DIR/stdout.log
tail -n 10 $DIR/cdc.log
sudo cp -r -L $DIR/{*.log} ./logs/$CASE/
sudo cp -r -L $DIR/{sync_diff} ./logs/$CASE/ || true
sudo chown -R runner ./logs
sudo tar -czvf ./logs.tar.gz ./logs
# Update logs as artifact seems not stable, so we set `continue-on-error: true` here.
- name: Upload logs
uses: actions/upload-artifact@v4
if: ${{ always() }}
- name: Upload test logs
if: always()
uses: ./.github/actions/upload-test-logs
with:
name: upstream-switch-logs
path: |
./logs.tar.gz
log-name: basic_e2e_group1


failover_e2e_test1:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -132,20 +117,12 @@ jobs:
pwd && ls -l bin/ && ls -l tools/bin/
export TICDC_NEWARCH=true && make integration_test CASE=fail_over_ddl_A
- name: Copy logs to hack permission
if: ${{ always() }}
run: |
TEMP_DIR=$(mktemp -d)
mkdir -p "$TEMP_DIR"
sudo find /tmp/tidb_cdc_test -type d -name 'fail_over*' -exec sh -c 'find "{}" -type f -name "cdc*.log" -print0' \; | tar -czvf logs.tar.gz -C /tmp/tidb_cdc_test --null -T -
# Update logs as artifact seems not stable, so we set `continue-on-error: true` here.
- name: Upload logs
uses: actions/upload-artifact@v4
if: ${{ always() }}
- name: Upload test logs
if: always()
uses: ./.github/actions/upload-test-logs
with:
name: upstream-failover-logs1
path: |
./logs.tar.gz
log-name: failover_group1


failover_e2e_test2:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -205,16 +182,9 @@ jobs:
pwd && ls -l bin/ && ls -l tools/bin/
export TICDC_NEWARCH=true && make integration_test CASE=fail_over_ddl_A
- name: Copy logs to hack permission
if: ${{ always() }}
run: |
TEMP_DIR=$(mktemp -d)
mkdir -p "$TEMP_DIR"
sudo find /tmp/tidb_cdc_test -type d -name 'fail_over*' -exec sh -c 'find "{}" -type f -name "cdc*.log" -print0' \; | tar -czvf logs.tar.gz -C /tmp/tidb_cdc_test --null -T -
# Update logs as artifact seems not stable, so we set `continue-on-error: true` here.
- name: Upload logs
uses: actions/upload-artifact@v4
if: ${{ always() }}
- name: Upload test logs
if: always()
uses: ./.github/actions/upload-test-logs
with:
name: upstream-failover-logs2
path: |
Expand Down Expand Up @@ -259,17 +229,11 @@ jobs:
pwd && ls -l bin/ && ls -l tools/bin/
export TICDC_NEWARCH=true && make integration_test CASE=fail_over_ddl_A
- name: Copy logs to hack permission
if: ${{ always() }}
run: |
TEMP_DIR=$(mktemp -d)
mkdir -p "$TEMP_DIR"
sudo find /tmp/tidb_cdc_test -type d -name 'fail_over*' -exec sh -c 'find "{}" -type f -name "cdc*.log" -print0' \; | tar -czvf logs.tar.gz -C /tmp/tidb_cdc_test --null -T -
# Update logs as artifact seems not stable, so we set `continue-on-error: true` here.
- name: Upload logs
uses: actions/upload-artifact@v4
if: ${{ always() }}
- name: Upload test logs
if: always()
uses: ./.github/actions/upload-test-logs
with:
name: upstream-failover-logs3
path: |
./logs.tar.gz
Loading

0 comments on commit 4c82a72

Please sign in to comment.