PingCAP-QE / ci

Continue intergration tests
Apache License 2.0
19 stars 97 forks source link

fix(tiflash): correct the dir to collect log #2947

Closed purelind closed 2 months ago

purelind commented 2 months ago

correct the dir to collect log.

ti-chi-bot[bot] commented 2 months ago

I have already done a preliminary review for you, and I hope to help you do a better job.

Pull Request Summary: The main change in this PR is the modification of the log collection directory in several files related to the pull integration tests for the 'tiflash' component. The changes are applied uniformly across different release versions of the product. Specifically, the PR encapsulates the log collection and archiving code in a 'dir' block that points to the correct working directory.

Potential Problems:

  1. Directory path: There can be errors if the ${WORKSPACE}/tiflash/tests/${TEST_PATH} directory doesn't exist or has incorrect permissions.
  2. Archive command: tar -czvf ${TEST_PATH}-logs.tar.gz {} + will create a new archive file for every log file found. This might not be the desired behavior if there are multiple log files.
  3. Docker command: docker ps -a is used without any follow-up action. If the intent was to debug, this might not be helpful in a CI/CD pipeline as the output might get lost in the logs.

Fixing Suggestions:

  1. Ensure directory path: Add checks to ensure ${WORKSPACE}/tiflash/tests/${TEST_PATH} exists and has the correct permissions before attempting to use it.
  2. Modify the archive command: If the intent is to archive all log files into one archive, then the tar command should be modified to do so.
  3. Use Docker command effectively: If the intent of docker ps -a is to debug, consider capturing its output into a file and add that file to the artifacts to be archived.
purelind commented 2 months ago

test link https://do.pingcap.net/jenkins/job/pingcap/job/tiflash/job/pull_integration_test/103/ test link https://do.pingcap.net/jenkins/job/pingcap/job/tiflash/job/pull_integration_test/105/

ti-chi-bot[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - **[pipelines/OWNERS](https://github.com/PingCAP-QE/ci/blob/main/pipelines/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment