Skip to content

Commit

Permalink
Remove tests (#207)
Browse files Browse the repository at this point in the history
* Remove tests

The "create app with stack" has been pending for a long time. The "create app with HATCHET_DEFAULT_STACK is tightly coupled to the stack and providing limited value.

close #206

* Remove more heroku-18 dependent tests
  • Loading branch information
schneems authored Jan 16, 2024
1 parent 3018262 commit 9ab310f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 58 deletions.
13 changes: 0 additions & 13 deletions spec/hatchet/app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@
expect(app.platform_api.app.info(app.name)["build_stack"]["name"]).to eq(stack)
end

it "create app with HATCHET_DEFAULT_STACK set" do
begin
original_default_stack = ENV["HATCHET_DEFAULT_STACK"]
default_stack = "heroku-18"
ENV["HATCHET_DEFAULT_STACK"] = default_stack
app = Hatchet::App.new("default_ruby")
app.create_app
expect(app.platform_api.app.info(app.name)["build_stack"]["name"]).to eq(default_stack)
ensure
ENV["HATCHET_DEFAULT_STACK"] = original_default_stack
end
end

describe "before deploy" do
it "dir" do
@called = false
Expand Down
47 changes: 2 additions & 45 deletions spec/hatchet/ci_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "spec_helper"

describe "CIFourTest" do
it "error with bad app" do
describe "CI" do
it "runs rakefile contents" do
string = SecureRandom.hex

app = Hatchet::GitApp.new("default_ruby")
Expand All @@ -17,47 +17,4 @@
expect(test_run.output).to_not match("Installing rake")
end
end

it "error with bad app" do
pending("upgrade rails 5 app to newer")

expect {
Hatchet::GitApp.new("rails5_ci_fails_no_database", stack: "heroku-18").run_ci { }
}.to raise_error(/PG::ConnectionBad: could not connect to server/)
end

it "error with bad app" do
@before_deploy_called = false
@before_deploy_dir_pwd = nil

before_deploy = -> do
@before_deploy_called = true
@before_deploy_dir_pwd = Dir.pwd
end

Hatchet::GitApp.new("rails5_ci_fails_no_database", stack: "heroku-18", allow_failure: true, before_deploy: before_deploy).run_ci do |test_run|
expect(test_run.status).to eq(:errored)
expect(@before_deploy_dir_pwd).to eq(Dir.pwd)
expect(@before_deploy_called).to be_truthy
end

expect(@before_deploy_dir_pwd).to_not eq(Dir.pwd)
end

it "ci create app with stack" do
pending("upgrade rails 5 app to newer")

app = Hatchet::GitApp.new("rails5_ruby_schema_format")
app.run_ci do |test_run|
expect(test_run.output).to match("Ruby buildpack tests completed successfully")
expect(test_run.status).to eq(:succeeded)
expect(app.pipeline_id).to_not be_nil

api_rate_limit = app.api_rate_limit.call
couplings = api_rate_limit.pipeline_coupling.list_by_pipeline(app.pipeline_id)
coupled_app = api_rate_limit.app.info(couplings.first["app"]["id"])
expect(coupled_app["name"]).to eq(app.name)
end
expect(app.pipeline_id).to be_nil
end
end

0 comments on commit 9ab310f

Please sign in to comment.