Sha256: eeabd6a2b9f72a92851633dc71f163d65862a1daef6b79654ed0bb4cb85b3e16

Contents?: true

Size: 1.64 KB

Versions: 33

Compression:

Stored size: 1.64 KB

Contents

require 'spec_helper'

describe "Deploying an application with platform configure command" do
  describe "configure script does not exist" do
    before do
      @releases_failed = deploy_dir.join('releases_failed')
      deploy_test_application('default')
    end

    it "works without warning" do
      expect(read_output).not_to match(/WARNING/)

      expect(@releases_failed).not_to exist
    end
  end

  describe "a succesful deploy" do
    before do
      @releases_failed = deploy_dir.join('releases_failed')
      ENV['EY_SERVERSIDE_CONFIGURE_COMMAND'] = "echo platform_configure_command_ran >&2"
      deploy_test_application('default')
    end

    after do
      ENV.delete('EY_SERVERSIDE_CONFIGURE_COMMAND')
    end

    it "runs the configure_command during deploy and finishes successfully" do
      expect(read_output).to match(/platform_configure_command_ran/)

      expect(@releases_failed).not_to exist

      restart = deploy_dir.join('current', 'restart')
      expect(restart).to exist
    end
  end

  describe "a failed configure command" do

    before do
      ENV['EY_SERVERSIDE_CONFIGURE_COMMAND'] = "echo platform_configure_command_failed >&2 && false"
    end

    after do
      ENV.delete('EY_SERVERSIDE_CONFIGURE_COMMAND')
    end

    it "aborts the deplo when it fails, preventing the app from being restarted" do
      @releases_failed = deploy_dir.join('releases_failed')
      expect(@releases_failed).not_to exist

      begin
        deploy_test_application('default')
      rescue
      end
      expect(read_output).to match(/platform_configure_command_failed/)

      expect(@releases_failed.entries).not_to be_empty
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
engineyard-serverside-2.8.0.pre4 spec/platform_configure_spec.rb
engineyard-serverside-2.8.0.pre spec/platform_configure_spec.rb
engineyard-serverside-2.6.17 spec/platform_configure_spec.rb
engineyard-serverside-2.6.15.pre spec/platform_configure_spec.rb
engineyard-serverside-2.6.14 spec/platform_configure_spec.rb
engineyard-serverside-2.6.13 spec/platform_configure_spec.rb
engineyard-serverside-2.6.12 spec/platform_configure_spec.rb
engineyard-serverside-2.6.12.prewut5 spec/platform_configure_spec.rb
engineyard-serverside-2.6.12.prewut4 spec/platform_configure_spec.rb
engineyard-serverside-2.6.12.prewut3 spec/platform_configure_spec.rb
engineyard-serverside-2.6.12.prewut2 spec/platform_configure_spec.rb
engineyard-serverside-2.6.12.prewut1 spec/platform_configure_spec.rb
engineyard-serverside-2.6.12.prewut0 spec/platform_configure_spec.rb
engineyard-serverside-2.6.11 spec/platform_configure_spec.rb
engineyard-serverside-2.6.10 spec/platform_configure_spec.rb
engineyard-serverside-2.6.9pre3 spec/platform_configure_spec.rb
engineyard-serverside-2.6.9pre2 spec/platform_configure_spec.rb
engineyard-serverside-2.6.9pre1 spec/platform_configure_spec.rb
engineyard-serverside-2.6.8 spec/platform_configure_spec.rb
engineyard-serverside-2.6.8pre2 spec/platform_configure_spec.rb