github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/engine/test/integration_tests/e2e_with_selectors/run.sh (about)

     1  #!/bin/bash
     2  
     3  set -eu
     4  
     5  WORK_DIR=$OUT_DIR/$TEST_NAME
     6  CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
     7  
     8  CONFIG="$DOCKER_COMPOSE_DIR/3m3e.yaml"
     9  CONFIG=$(adjust_config $OUT_DIR $TEST_NAME $CONFIG)
    10  echo "using adjusted configs to deploy cluster: $CONFIG"
    11  
    12  function run() {
    13  	start_engine_cluster $CONFIG
    14  	# add a delay in case that the cluster is not ready
    15  	sleep 3
    16  
    17  	selectors='[{ "label": "name", "target": "exec-1", "op": "Eq" }]'
    18  	job_id=$(create_job "FakeJob" $CUR_DIR/conf/fake_job.json "fake_job" "tenant_id_e2e_selector" "project_id_e2e_selector" "$selectors")
    19  	echo "job_id: $job_id"
    20  
    21  	exec_with_retry --count 100 "curl \"http://127.0.0.1:10245/api/v1/jobs/$job_id\" | tee /dev/stderr | jq -e '.state == \"Finished\"'"
    22  }
    23  
    24  trap "stop_engine_cluster $WORK_DIR $CONFIG" EXIT
    25  run $*
    26  echo "[$(date)] <<<<<< run test case $TEST_NAME success! >>>>>>"