Last active
December 27, 2015 16:49
-
-
Save daviddavis/7357809 to your computer and use it in GitHub Desktop.
Script for running individual Katello::Engine tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [[ -n $1 ]] | |
then | |
RAKE_PATH=`bundle show rake` | |
ruby -I"lib:test:${KATELLO_PATH}/test:${KATELLO_PATH}/spec" -I"${RAKE_PATH}/lib" \ | |
"${RAKE_PATH}/lib/rake/rake_test_loader.rb" $@ ${KATELLO_PATH}/test/katello_test_runner.rb | |
else | |
bundle exec rake test:katello | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should be faster than
rake test:katello
since you're bypassing rake and its dependencies. Moreover you can do stuff like run individual tests (see below).Setting KATELLO_PATH
In order to run this script you need to make sure you have $KATELLO_PATH set to your katello directory. You can either export it:
Or you could even add this to the top of the script:
KATELLO_PATH=$HOME/workspace/katello
Where
~/workspace/katello
would be your katello directory.Usage
Run all the tests
Run the puppet module tests
Run the parse_metadata test in puppet module test file
Time Comparison
Running ruby directly tends to speed up the time by about 60-80 seconds.
rake test:katello TEST=../katello/test/models/puppet_module_test.rb
ktest ../katello/test/models/puppet_module_test.rb