mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
97f783ce96
* Update travis config to only setup hatchet when running hatchet [changelog skip] Fix a bug in the hatchet tests, and allow previous builds to finish before running the next test * Add logging when skipping hatchet tests Only skip hatchet tests on a forked PR * Build on Travis only for master branch * Upgrade from trusty to bionic on Travis
39 lines
1.0 KiB
Ruby
39 lines
1.0 KiB
Ruby
ENV['HATCHET_BUILDPACK_BASE'] = 'https://github.com/' + ENV['TRAVIS_REPO_SLUG'] + '.git'
|
|
|
|
require 'rspec/core'
|
|
require 'rspec/retry'
|
|
require 'hatchet'
|
|
|
|
require 'date'
|
|
|
|
RSpec.configure do |config|
|
|
config.full_backtrace = true
|
|
config.verbose_retry = true # show retry status in spec process
|
|
config.default_retry_count = 2 if ENV['IS_RUNNING_ON_CI'] # retry all tests that fail again
|
|
config.expect_with :rspec do |c|
|
|
c.syntax = :expect
|
|
end
|
|
end
|
|
|
|
if ENV['TRAVIS']
|
|
# Don't execute tests against "merge" commits
|
|
if ENV['TRAVIS_PULL_REQUEST'] != 'false' &&
|
|
ENV['TRAVIS_BRANCH'] == 'master' &&
|
|
ENV["TRAVIS_PULL_REQUEST_SLUG"] != ENV['TRAVIS_REPO_SLUG'] # forked PR
|
|
puts "Skipping Hatchet tests"
|
|
exit 0
|
|
end
|
|
end
|
|
|
|
DEFAULT_STACK = 'heroku-18'
|
|
|
|
def run!(cmd)
|
|
out = `#{cmd}`
|
|
raise "Error running command #{cmd} with output: #{out}" unless $?.success?
|
|
return out
|
|
end
|
|
|
|
def init_app(app, stack=DEFAULT_STACK)
|
|
app.setup!
|
|
app.platform_api.app.update(app.name, {"build_stack" => ENV["HEROKU_TEST_STACK"] || stack})
|
|
end |