JAMKAZAM_TESTING_BUCKET = 'jamkazam-testing' # cuz i'm not comfortable using aws_bucket accessor directly def app_config klass = Class.new do def aws_bucket JAMKAZAM_TESTING_BUCKET end def aws_access_key_id 'AKIAJESQY24TOT542UHQ' end def aws_secret_access_key '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' end def audiomixer_path # you can specify full path to audiomixer with AUDIOMIXER_PATH env variable... # or we check for audiomixer path in the user's workspace # and finally the debian install path ENV['AUDIOMIXER_PATH'] || audiomixer_workspace_path || "/var/lib/audiomixer/audiomixer/audiomixerapp" end def icecast_reload_cmd 'true' # as in, /bin/true end def icecast_config_file Dir::Tmpname.make_tmpname(["#{Dir.tmpdir}/icecast", 'xml'], nil) end def icecast_server_id 'test' end def icecast_max_missing_check 2 * 60 # 2 minutes end def icecast_max_sourced_changed 15 # 15 seconds end def rabbitmq_host "localhost" end def rabbitmq_port 5672 end private def audiomixer_workspace_path if ENV['WORKSPACE'] dev_path = ENV['WORKSPACE'] else dev_path = ENV['HOME'] end dev_path = "#{dev_path}/audiomixer/audiomixer/audiomixerapp" dev_path if File.exist? dev_path end end return klass.new end def run_tests? type type = type.to_s.capitalize ENV["RUN_#{type}_TESTS"] == "1" || ENV[type] == "1" || ENV['ALL_TESTS'] == "1" end def wipe_s3_test_bucket # don't bother if the user isn't doing AWS tests if run_tests? :aws test_config = app_config s3 = AWS::S3.new(:access_key_id => test_config.aws_access_key_id, :secret_access_key => test_config.aws_secret_access_key) test_bucket = s3.buckets[JAMKAZAM_TESTING_BUCKET] if test_bucket.name == JAMKAZAM_TESTING_BUCKET #test_bucket.clear! end end end