github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/engine/test/integration_tests/README.md (about)

     1  ## Preparations
     2  
     3  The following programs must be installed:
     4  
     5  * [docker](https://docs.docker.com/get-docker/)
     6  * [docker-compose](https://docs.docker.com/compose/install/)
     7  
     8  Besides, make sure you have run the docker daemon. We recommend that you provide docker with at least 6+ cores and 8G+ memory. Of course, the more resources, the better.
     9  
    10  ## Run engine integration tests
    11  
    12  1. Run `make engine_image` to generate engine related image for integration test.
    13     Or you can run `make tiflow`, `make tiflow-demo`, `make tiflow-chaos-case` to build necessary binaries in your local environment,
    14     then run `make engine_image_from_local` to generate image by local binaries.
    15  2. Run `make engine_integration_test` to execute the integration tests. This command will
    16  
    17     1. Check that all required executables exist.
    18     2. Execute `engine/test/integration_tests/run.sh`
    19  
    20     > If want to run one integration test case only, just pass the CASE parameter, such as `make engine_integration_test CASE=e2e_basic`.
    21     > If want to run integration test cases from the specified one, just pass the START_AT parameter, such as `make engine_integration_test START_AT=e2e_basic` .
    22     > You can specify multiple tests to run in CASE, for example: `CASE="e2e_basic e2e_worker_error"`. You can even
    23     > use `CASE="*"` to indicate that you are running all tests.
    24     >
    25  3. Check logs in `/tmp/tiflow_engine_test/${TEST_NAME}`
    26  
    27  ## Writing new tests
    28  
    29  1. New integration tests can be written as shell scripts in `engine/test/integration_tests/TEST_NAME/run.sh`. The script should
    30  exit with a nonzero error code on failure.
    31  2. Add TEST_NAME to existing group in [run_group.sh](./run_group.sh), or add a new group for it.
    32  3. If you add a new group, the name of the new group must be added to CI.
    33     * [engine-integration-test](https://github.com/PingCAP-QE/ci/blob/main/pipelines/pingcap/tiflow/latest/pull_engine_integration_test.groovy)
    34  
    35  ## Debug
    36  
    37  1. Deploy cluster via debug mode
    38  
    39  ```bash
    40  configs="../../../deployments/engine/docker-compose/3m3e.yaml ../../../deployments/engine/docker-compose/dm_databases.yaml" 
    41  ./run.sh debug ${configs}
    42  ```
    43  
    44  2. Run test scripts
    45  3. Check logs in `/tmp/tiflow_engine_test/debug`