Skip to content

Rails smoke test during release phase? #1120

Open
@CGA1123

Description

@CGA1123

Hi, the buildpack currently does some fingerprinting to notice whether the ruby app being deployed is a rails app by attempting to run rails runner.

If the application is a rails application but for some reason can't be loaded properly (maybe some configuration differences between CI and production) this test will fail but the release will still succeed.

We've adding a rake task to all of our applications as part of the release task in our Procfile that does runs rails runner and if there is a failure returns the non-zero exit code causing the release to fail and therefore does not actually release the applications.

This can catch some awkward issues that can slip through dev and CI and cause apps to deploy but not be able to actually process any requests!

require 'open3'

task final_frontier: :environment do
  _, stderr, status = Open3.capture3("rails runner 'puts Rails.env'")

  raise "Rails app failed to boot:\n\n#{stderr}" unless status.success?
end

Is this something that could be useful to be included in this buildpack?
Maybe only added if there is an explicit ENV var that denotes that the applications is expected to be running rails?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions