mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Bugfix: Caching on subsequent redeploys (#948)
* Don't clear the cache on first app deploy * Add output for debugging cache behavior * Debug output of changes, clean up whitespace * Update hatchet to use latest getting started guide * Clean up caching output logs This output was confusing and unhelptul to most users * Changelog * Test if we need these lines * dang fi * Remove unnecessary code * Remove confusing output of change * Update log output * Update test to match new expected log output * Update changelog
This commit is contained in:
@@ -3,26 +3,40 @@ require_relative '../spec_helper'
|
||||
describe "Default Python Deploy" do
|
||||
it "🐍" do
|
||||
Hatchet::Runner.new('python-getting-started', stack: DEFAULT_STACK).deploy do |app|
|
||||
|
||||
# What should happen on first deploy
|
||||
expect(app.output).to match(/Installing pip/)
|
||||
expect(app.run('python -V')).to match(/3.6.10/)
|
||||
|
||||
# What should not happen
|
||||
expect(app.output).to_not match("Requirements file has been changed, updating cache")
|
||||
expect(app.output).to_not match("No change in requirements detected, installing from cache")
|
||||
expect(app.output).to_not match("No such file or directory")
|
||||
expect(app.output).to_not match("cp: cannot create regular file")
|
||||
|
||||
expect(app.output).to_not match("Clearing cached dependencies")
|
||||
|
||||
# Redeploy
|
||||
# Redeploy with changed requirements file
|
||||
run!(%Q{echo "" >> requirements.txt})
|
||||
run!(%Q{echo "flask" >> requirements.txt})
|
||||
run!(%Q{git add . ; git commit --allow-empty -m next})
|
||||
app.push!
|
||||
|
||||
# Check for the cache tohave cleared
|
||||
expect(app.output).to match("Clearing cached dependencies")
|
||||
# Check for the cache to have cleared
|
||||
expect(app.output).to match("Requirements file has been changed, updating cache")
|
||||
|
||||
# What should not happen when the requirements file is changed
|
||||
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")
|
||||
|
||||
run!(%Q{git commit --allow-empty -m next})
|
||||
app.push!
|
||||
|
||||
# The cache should not clear with no changes
|
||||
expect(app.output).to_not match("Clearing cached dependencies")
|
||||
# With no changes on redeploy, the cache should
|
||||
expect(app.output).to match("No change in requirements detected, installing from cache")
|
||||
|
||||
# With no changes on redeploy, the cache should not
|
||||
expect(app.output).to_not match("Requirements file has been changed, updating cache")
|
||||
expect(app.output).to_not match("No dependencies found, preparing to install")
|
||||
|
||||
expect(app.run('python -V')).to match(/3.7.3/)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user