File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ cd " $( dirname " ${BASH_SOURCE[0]} " ) /.."
6
+
7
+ if [ " $CONTAINER " == " true" ]; then
8
+ source ./container_env
9
+ fi
10
+
11
+ # Ensure bats and its support repos are installed
12
+ if [ ! -x " $( command -v bats) " ]; then
13
+ if [ " $APPLIANCE " == " true" ]; then
14
+ echo -e " \033[1;34mInstalling bats...\033[0m"
15
+ dnf install -y bats
16
+ else
17
+ echo -e " \033[1;31mERROR: Unable to find the bats test framework.\033[0m"
18
+ exit 1
19
+ fi
20
+ fi
21
+ bats_lib_path=$( echo ${BATS_LIB_PATH:- $HOME / .bats/ libs} | cut -d " :" -f 1)
22
+ if [ ! -d " $bats_lib_path /bats-support" ]; then
23
+ echo -e " \033[1;34mInstalling bats-support...\033[0m"
24
+ git clone https://github.com/bats-core/bats-support $bats_lib_path /bats-support
25
+ fi
26
+ if [ ! -d " $bats_lib_path /bats-assert" ]; then
27
+ echo -e " \033[1;34mInstalling bats-assert...\033[0m"
28
+ git clone https://github.com/bats-core/bats-assert $bats_lib_path /bats-assert
29
+ fi
30
+
31
+ # Ensure the test files exist. If not, clone from upstream github master
32
+ if [ ! -d " ./spec/lib/ansible" ]; then
33
+ echo -e " \033[1;34mCloning ansible specs...\033[0m"
34
+ rm -rf /tmp/manageiq
35
+ git clone --no-checkout --depth=1 --filter=tree:0 https://github.com/ManageIQ/manageiq /tmp/manageiq
36
+ pushd /tmp/manageiq
37
+ git sparse-checkout set --no-cone /spec/lib/ansible
38
+ git checkout
39
+ popd
40
+
41
+ mkdir -p ./spec/lib
42
+ cp -r /tmp/manageiq/spec/lib/ansible ./spec/lib
43
+ rm -rf /tmp/manageiq
44
+ fi
45
+
46
+ # Run the tests
47
+ echo -e " \033[1;34mRunning tests...\033[0m"
48
+ exec bats ./spec/lib/ansible/runner_execution_spec.bats
Original file line number Diff line number Diff line change
1
+ namespace :test do
2
+ desc "Run ansible_runner execution tests"
3
+ task :ansible_runner_execution do
4
+ exec File . expand_path ( "../../bin/test_ansible_runner_execution" , __dir__ )
5
+ end
6
+ end
You can’t perform that action at this time.
0 commit comments