Skip to content

Commit 567cf2c

Browse files
authored
Merge pull request #742 from heroku/hatchet/yay
Hatchet/yay
2 parents 39d2cd6 + c61e61c commit 567cf2c

File tree

9 files changed

+159
-22
lines changed

9 files changed

+159
-22
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ site
33
.DS_Store
44

55
/.envrc
6+
repos/*

.travis.yml

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,42 @@
1-
language: bash
1+
language: ruby
22
dist: trusty
3+
rvm:
4+
- 2.4.4
5+
before_script:
6+
- gem install bundler -v 1.16.2
7+
- bundle exec rake hatchet:setup_travis
8+
addons:
9+
apt:
10+
sources:
11+
- heroku
12+
packages:
13+
- heroku-toolbelt
314
jobs:
415
include:
5-
- stage: "Bash linting (shellcheck)"
6-
sudo: false
7-
before_install:
8-
- wget -c https://goo.gl/ZzKHFv -O - | tar -xvJ -C /tmp/
9-
- PATH="/tmp/shellcheck-latest:$PATH"
10-
script: make check
11-
12-
- stage: "Stack Tests"
13-
services: docker
14-
env: STACK=heroku-18
15-
script: ./tests.sh
16-
17-
- stage: "Stack Tests"
18-
services: docker
19-
env: STACK=heroku-16
20-
script: ./tests.sh
21-
22-
- stage: "Stack Tests"
23-
services: docker
24-
env: STACK=cedar-14
25-
script: ./tests.sh
16+
- stage: Bash linting (shellcheck)
17+
sudo: false
18+
before_install:
19+
- wget -c https://goo.gl/ZzKHFv -O - | tar -xvJ -C /tmp/
20+
- PATH="/tmp/shellcheck-latest:$PATH"
21+
script: make check
22+
- stage: Stack Unit Tests
23+
services: docker
24+
env: STACK=heroku-18
25+
script: "./tests.sh"
26+
- stage: Stack Unit Tests
27+
services: docker
28+
env: STACK=heroku-16
29+
script: "./tests.sh"
30+
- stage: Stack Unit Tests
31+
services: docker
32+
env: STACK=cedar-14
33+
script: "./tests.sh"
34+
- stage: Hatchet Integration
35+
script: "bundle exec rspec"
36+
env:
37+
global:
38+
- HATCHET_RETRIES=3
39+
- IS_RUNNING_ON_CI=true
40+
- HATCHET_APP_LIMIT=5
41+
- secure: yjtlPE5FbVxTKnjUy/tZUBgSEf4qADD3QOxtgziuid73S0U/1IEXlMGFULsQzIjtlHKmHeywZqpVVEpthIH4RuT7uoX1Pb7SSM/g0T8fT3VoEFbFK1uYl0oZQbUS4Klxv9tPiumj8if3m6ULEGIz1X0wZcMOC0tMLwVCnwmap0E=
42+
- secure: ZeFTHWwnpIKE9nAqs88ocmiQh7bKce84lilGm5J23nf3N6V4wNyLwqlkvsM008WGBCaOg9AUx7ZunasT0ANsR5gLP3eV2UUg7ILdRgV2Gy13eNRFheC4PHdN92RqQ3aKoqlIv2K999xlhVjod0NzhkQQXB6PddfQINbuU7ks6As=

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source "https://rubygems.org"
2+
3+
gem "rspec"
4+
gem "heroku_hatchet"
5+
gem "rspec-retry"
6+
gem "rake"

Gemfile.lock

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
activesupport (5.2.1)
5+
concurrent-ruby (~> 1.0, >= 1.0.2)
6+
i18n (>= 0.7, < 2)
7+
minitest (~> 5.1)
8+
tzinfo (~> 1.1)
9+
concurrent-ruby (1.0.5)
10+
diff-lcs (1.3)
11+
erubis (2.7.0)
12+
excon (0.62.0)
13+
heroics (0.0.24)
14+
erubis (~> 2.0)
15+
excon
16+
moneta
17+
multi_json (>= 1.9.2)
18+
heroku_hatchet (4.0.2)
19+
excon (~> 0)
20+
minitest-retry (~> 0.1.9)
21+
platform-api (~> 2)
22+
repl_runner (~> 0.0.3)
23+
rrrretry (~> 1)
24+
thor (~> 0)
25+
threaded (~> 0)
26+
i18n (1.1.0)
27+
concurrent-ruby (~> 1.0)
28+
minitest (5.11.3)
29+
minitest-retry (0.1.9)
30+
minitest (>= 5.0)
31+
moneta (0.8.1)
32+
multi_json (1.13.1)
33+
platform-api (2.1.0)
34+
heroics (~> 0.0.23)
35+
moneta (~> 0.8.1)
36+
rake (12.3.1)
37+
repl_runner (0.0.3)
38+
activesupport
39+
rrrretry (1.0.0)
40+
rspec (3.8.0)
41+
rspec-core (~> 3.8.0)
42+
rspec-expectations (~> 3.8.0)
43+
rspec-mocks (~> 3.8.0)
44+
rspec-core (3.8.0)
45+
rspec-support (~> 3.8.0)
46+
rspec-expectations (3.8.1)
47+
diff-lcs (>= 1.2.0, < 2.0)
48+
rspec-support (~> 3.8.0)
49+
rspec-mocks (3.8.0)
50+
diff-lcs (>= 1.2.0, < 2.0)
51+
rspec-support (~> 3.8.0)
52+
rspec-retry (0.6.1)
53+
rspec-core (> 3.3)
54+
rspec-support (3.8.0)
55+
thor (0.20.0)
56+
thread_safe (0.3.6)
57+
threaded (0.0.4)
58+
tzinfo (1.2.5)
59+
thread_safe (~> 0.1)
60+
61+
PLATFORMS
62+
ruby
63+
64+
DEPENDENCIES
65+
heroku_hatchet
66+
rake
67+
rspec
68+
rspec-retry
69+
70+
BUNDLED WITH
71+
1.16.3

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'hatchet/tasks'

hatchet.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"python": [
3+
"heroku/python-getting-started"
4+
]
5+
}

hatchet.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
- - "./repos/python/python-getting-started"
3+
- f56b90499ec11e1c9576da2f8c7331300e189db3

spec/hatchet/python_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require_relative '../spec_helper'
2+
3+
describe "Python!!!!!!!!!!!" do
4+
it "🐍" do
5+
Hatchet::Runner.new('python-getting-started', stack: DEFAULT_STACK).deploy do |app|
6+
expect(app.output).to match(/Installing pip/)
7+
expect(app.run('python -V')).to match(/3.6.6/)
8+
end
9+
end
10+
end

spec/spec_helper.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
ENV['HATCHET_BUILDPACK_BASE'] = 'https://github.com/heroku/heroku-buildpack-python.git'
2+
3+
require 'rspec/core'
4+
require 'rspec/retry'
5+
require 'hatchet'
6+
7+
require 'date'
8+
9+
RSpec.configure do |config|
10+
config.full_backtrace = true
11+
config.verbose_retry = true # show retry status in spec process
12+
config.default_retry_count = 2 if ENV['IS_RUNNING_ON_CI'] # retry all tests that fail again
13+
config.expect_with :rspec do |c|
14+
c.syntax = :expect
15+
end
16+
end
17+
18+
if ENV['TRAVIS']
19+
# Don't execute tests against "merge" commits
20+
exit 0 if ENV['TRAVIS_PULL_REQUEST'] != 'false' && ENV['TRAVIS_BRANCH'] == 'master'
21+
end
22+
23+
DEFAULT_STACK = 'heroku-16'

0 commit comments

Comments
 (0)