Update travis config [changelog skip] (#963)

* 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
This commit is contained in:
Joe Kutner
2020-04-23 17:55:05 -07:00
committed by GitHub
parent 106f2997fa
commit 97f783ce96
3 changed files with 24 additions and 4 deletions
+7 -3
View File
@@ -1,12 +1,14 @@
language: ruby
dist: trusty
dist: bionic
sudo: required
branches:
only:
- master
rvm:
- 2.4.4
before_script:
- gem install bundler -v 1.16.2
- bundle exec hatchet ci:setup
script:
- docker build --pull --tag travis-build-cedar-14 --file $(pwd)/builds/cedar-14.Dockerfile .
@@ -24,7 +26,9 @@ jobs:
- stage: Hatchet Integration
if: branch = master
name: Run Hatchet
script: "bundle exec rspec"
script:
- bundle exec hatchet ci:setup
- bundle exec rspec
env:
matrix:
- TESTFOLDER=test/run-deps
+6
View File
@@ -31,6 +31,9 @@ describe "Default Python Deploy" do
expect(app.output).to_not match("No such file or directory")
expect(app.output).to_not match("cp: cannot create regular file")
# let the previous build finish
sleep(5)
# Redeploy with changed requirements file
run!(%Q{echo "" >> requirements.txt})
run!(%Q{echo "flask" >> requirements.txt})
@@ -44,6 +47,9 @@ describe "Default Python Deploy" do
expect(app.output).to_not match("No dependencies found, preparing to install")
expect(app.output).to_not match("No change in requirements detected, installing from cache")
# let the previous build finish
sleep(5)
run!(%Q{git commit --allow-empty -m next})
app.push!
+11 -1
View File
@@ -17,7 +17,12 @@ end
if ENV['TRAVIS']
# Don't execute tests against "merge" commits
exit 0 if ENV['TRAVIS_PULL_REQUEST'] != 'false' && ENV['TRAVIS_BRANCH'] == 'master'
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'
@@ -27,3 +32,8 @@ def run!(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