github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/tests/acceptance/test_files/brew.bats (about)

     1  load "$LIB_BATS_ASSERT/load.bash"
     2  load "$LIB_BATS_SUPPORT/load.bash"
     3  
     4  # Homebrew-core runs a set of tests in their release workflows. These tests replicate the 
     5  # tests that they run on steampipe. This is to make sure that there are no unknown failures
     6  # in their workflows
     7  
     8  @test "steampipe completion should not create INSTALL DIRs" {
     9    export STEAMPIPE_LOG=info
    10    # create a fresh target install dir
    11    target_install_directory=$(mktemp -d)
    12  
    13    run steampipe completion zsh --install-dir $target_install_directory
    14  
    15    # check no steampipe install directories are created at target_install_directory
    16    cd $target_install_directory
    17    directory_count=$(ls | wc -l)
    18    echo $directory_count
    19  
    20    # steampipe completion should not create INSTALL DIRs
    21    assert_equal $directory_count 0
    22  }
    23  
    24  function teardown_file() {
    25    # list running processes
    26    ps -ef | grep steampipe
    27  
    28    # check if any processes are running
    29    num=$(ps aux | grep steampipe | grep -v bats | grep -v grep | grep -v tests/acceptance | wc -l | tr -d ' ')
    30    assert_equal $num 0
    31  }