Skip to content

Commit

Permalink
pbTests: add optional extra skip tags to speed up testing (#1082)
Browse files Browse the repository at this point in the history
Signed-off-by: Stewart Addison <sxa@uk.ibm.com>
  • Loading branch information
sxa555 authored Jan 8, 2020
1 parent 6d59c92 commit 6c71c4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions ansible/pbTestScripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The top level script `vagrantPlayBookCheck.sh` takes a number of options:
| --URL / -u Git URL | Specify the URL of the infrastructure repo to clone * | `./vagrantPlaybookCheck.sh -a --URL https://github.com/sxa555/openjdk-infrastructure/tree/mybranch` |
| --test / -t | Run a small test on the built JDK within the VM ** | `./vagrantPlaybookCheck.sh -a --build --test` |
| --new-vagrant-file / -nv | Use the vagrant files from the new URL | `./vagrantPlaybookCheck.sh -a -nv --URL https://...` |
| --skip-more / -sm | For speed/testing skip tags not needed for build test | `./vagrantPlaybookCheck.sh -a -sm`
| --help | Displays usage | `./vagrantPlaybookCheck.sh --help` |

Notes:
Expand Down
8 changes: 6 additions & 2 deletions ansible/pbTestScripts/vagrantPlaybookCheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ runTest=false
vmHalt=true
cleanWorkspace=false
newVagrantFiles=false
skipFullSetup=''

# Takes all arguments from the script, and determines options
processArgs()
Expand All @@ -37,6 +38,8 @@ processArgs()
cleanWorkspace=true;;
"--new-vagrant-files" | "-nv" )
newVagrantFiles=true;;
"--skip-more" | "-sm" )
skipFullSetup=",nvidia_cuda_toolkit,MSVS_2010,MSVS_2017";;
"--help" | "-h" )
usage; exit 0;;
*) echo >&2 "Invalid option: ${opt}"; echo "This option was unrecognised."; usage; exit 1;;
Expand All @@ -55,6 +58,7 @@ usage()
--test | -t Runs a quick test on the built JDK
--no-halt | -n Option to stop the vagrant VMs halting
--new-vagrant-files | -nv Use vagrantfiles from the the specified git repository
--skip-more | -sm Run playbook faster by exluding things not required by buildJDK
--help | -h Displays this help message"
}

Expand Down Expand Up @@ -193,7 +197,7 @@ startVMPlaybook()
# NOTE! Only works with GNU sed
! grep -q "timeout" ansible.cfg && sed -i -e 's/\[defaults\]/&\ntimeout = 30/g' ansible.cfg
! grep -q "private_key_file" ansible.cfg && sed -i -e 's/\[defaults\]/&\nprivate_key_file = id_rsa/g' ansible.cfg
ansible-playbook -i playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx -u vagrant -b --skip-tags adoptopenjdk,jenkins playbooks/AdoptOpenJDK_Unix_Playbook/main.yml 2>&1 | tee $WORKSPACE/adoptopenjdkPBTests/logFiles/$folderName.$branchName.$OS.log
ansible-playbook -i playbooks/AdoptOpenJDK_Unix_Playbook/hosts.unx -u vagrant -b --skip-tags adoptopenjdk,jenkins${skipFullSetup} playbooks/AdoptOpenJDK_Unix_Playbook/main.yml 2>&1 | tee $WORKSPACE/adoptopenjdkPBTests/logFiles/$folderName.$branchName.$OS.log
echo The playbook finished at : `date +%T`
searchLogFiles $OS
local pb_failed=$?
Expand Down Expand Up @@ -234,7 +238,7 @@ startVMPlaybookWin()
echo -e "\nansible_winrm_transport: credssp" >> playbooks/AdoptOpenJDK_Windows_Playbook/group_vars/all/adoptopenjdk_variables.yml
fi
# Run the ansible playbook on the VM & logs the output.
ansible-playbook -i playbooks/AdoptOpenJDK_Windows_Playbook/hosts.win -u vagrant --skip-tags jenkins,adoptopenjdk,build playbooks/AdoptOpenJDK_Windows_Playbook/main.yml 2>&1 | tee $WORKSPACE/adoptopenjdkPBTests/logFiles/$folderName.$branchName.$OS.log
ansible-playbook -i playbooks/AdoptOpenJDK_Windows_Playbook/hosts.win -u vagrant --skip-tags jenkins,adoptopenjdk${skipFullSetup} playbooks/AdoptOpenJDK_Windows_Playbook/main.yml 2>&1 | tee $WORKSPACE/adoptopenjdkPBTests/logFiles/$folderName.$branchName.$OS.log
echo The playbook finished at : `date +%T`
searchLogFiles $OS
local pbFailed=$?
Expand Down

0 comments on commit 6c71c4e

Please sign in to comment.