github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/tests/dockertesting/debian/run-tests.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # check version
     4  steampipe -v
     5  
     6  # clone the repo, to run the test suite
     7  git clone https://github.com/turbot/steampipe.git
     8  cd steampipe
     9  
    10  # initialize git along with bats submodules
    11  git init
    12  git submodule update --init
    13  git submodule update --recursive
    14  git checkout $1
    15  git branch
    16  
    17  # declare the test file names
    18  declare -a arr=("migration" "service_and_plugin" "search_path" "chaos_and_query" "dynamic_schema" "cache" "mod_install" "mod" "check" "workspace" "cloud" "performance" "exit_codes")
    19  declare -i failure_count=0
    20  
    21  # run test suite
    22  for i in "${arr[@]}"
    23  do
    24    echo ""
    25    echo ">>>>> running $i.bats"
    26    ./tests/acceptance/run.sh $i.bats
    27    failure_count+=$?
    28  done
    29  
    30  # check if all tests passed
    31  echo $failure_count
    32  if [[ $failure_count -eq 0 ]]; then
    33    echo "test run successful"
    34    exit 0
    35  else
    36    echo "test run failed"
    37    exit 1
    38  fi