Merge branch 'main' into global-logging-config
This commit is contained in:
@@ -126,7 +126,7 @@ class CliAccessoryTest < CliTestCase
|
||||
end
|
||||
|
||||
test "remove_image" do
|
||||
assert_match "docker image prune --all --force --filter label=service=app-mysql", run_command("remove_image", "mysql")
|
||||
assert_match "docker image rm --force mysql", run_command("remove_image", "mysql")
|
||||
end
|
||||
|
||||
test "remove_service_directory" do
|
||||
|
||||
@@ -28,9 +28,8 @@ class CliAppTest < CliTestCase
|
||||
.returns([ :docker, :run ])
|
||||
|
||||
run_command("boot").tap do |output|
|
||||
assert_match "Rebooting container with same version 999 already deployed", output # Can't start what's already running
|
||||
assert_match "docker container ls --all --filter name=app-999 --quiet | xargs docker container rm", output # Stop old running
|
||||
assert_match "docker container ls --all --filter name=app-999 --quiet | xargs docker container rm", output # Remove old container
|
||||
assert_match "Rebooting container with same version latest already deployed", output # Can't start what's already running
|
||||
assert_match "docker container ls --all --filter name=app-latest --quiet | xargs docker container rm", output # Remove old container
|
||||
assert_match "docker run", output # Start new container
|
||||
end
|
||||
ensure
|
||||
|
||||
@@ -29,7 +29,7 @@ class CliBuildTest < CliTestCase
|
||||
test "pull" do
|
||||
run_command("pull").tap do |output|
|
||||
assert_match /docker image rm --force dhh\/app:999/, output
|
||||
assert_match /docker pull dhh\/app:999/, output
|
||||
assert_match /docker pull dhh\/app:latest/, output
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class CliMainTest < CliTestCase
|
||||
end
|
||||
|
||||
test "deploy" do
|
||||
invoke_options = { "config_file" => "test/fixtures/deploy_with_accessories.yml", "skip_broadcast" => false, "skip_push" => false }
|
||||
invoke_options = { "config_file" => "test/fixtures/deploy_with_accessories.yml", "skip_broadcast" => false, "version" => "999" }
|
||||
|
||||
Mrsk::Cli::Main.any_instance.expects(:invoke).with("mrsk:cli:server:bootstrap", [], invoke_options)
|
||||
Mrsk::Cli::Main.any_instance.expects(:invoke).with("mrsk:cli:registry:login", [], invoke_options)
|
||||
@@ -31,7 +31,7 @@ class CliMainTest < CliTestCase
|
||||
end
|
||||
|
||||
test "deploy with skip_push" do
|
||||
invoke_options = { "config_file" => "test/fixtures/deploy_with_accessories.yml", "skip_broadcast" => false, "skip_push" => true }
|
||||
invoke_options = { "config_file" => "test/fixtures/deploy_with_accessories.yml", "skip_broadcast" => false, "version" => "999" }
|
||||
|
||||
Mrsk::Cli::Main.any_instance.expects(:invoke).with("mrsk:cli:server:bootstrap", [], invoke_options)
|
||||
Mrsk::Cli::Main.any_instance.expects(:invoke).with("mrsk:cli:registry:login", [], invoke_options)
|
||||
@@ -52,7 +52,7 @@ class CliMainTest < CliTestCase
|
||||
end
|
||||
|
||||
test "redeploy" do
|
||||
invoke_options = { "config_file" => "test/fixtures/deploy_with_accessories.yml", "skip_broadcast" => false, "skip_push" => false}
|
||||
invoke_options = { "config_file" => "test/fixtures/deploy_with_accessories.yml", "skip_broadcast" => false, "version" => "999" }
|
||||
|
||||
Mrsk::Cli::Main.any_instance.expects(:invoke).with("mrsk:cli:build:deliver", [], invoke_options)
|
||||
Mrsk::Cli::Main.any_instance.expects(:invoke).with("mrsk:cli:healthcheck:perform", [], invoke_options)
|
||||
@@ -65,7 +65,7 @@ class CliMainTest < CliTestCase
|
||||
end
|
||||
|
||||
test "redeploy with skip_push" do
|
||||
invoke_options = { "config_file" => "test/fixtures/deploy_with_accessories.yml", "skip_broadcast" => false, "skip_push" => true }
|
||||
invoke_options = { "config_file" => "test/fixtures/deploy_with_accessories.yml", "skip_broadcast" => false, "version" => "999" }
|
||||
|
||||
Mrsk::Cli::Main.any_instance.expects(:invoke).with("mrsk:cli:build:pull", [], invoke_options)
|
||||
Mrsk::Cli::Main.any_instance.expects(:invoke).with("mrsk:cli:healthcheck:perform", [], invoke_options)
|
||||
@@ -235,12 +235,12 @@ class CliMainTest < CliTestCase
|
||||
|
||||
assert_match /docker container stop app-mysql/, output
|
||||
assert_match /docker container prune --force --filter label=service=app-mysql/, output
|
||||
assert_match /docker image prune --all --force --filter label=service=app-mysql/, output
|
||||
assert_match /docker image rm --force mysql/, output
|
||||
assert_match /rm -rf app-mysql/, output
|
||||
|
||||
assert_match /docker container stop app-redis/, output
|
||||
assert_match /docker container prune --force --filter label=service=app-redis/, output
|
||||
assert_match /docker image prune --all --force --filter label=service=app-redis/, output
|
||||
assert_match /docker image rm --force redis/, output
|
||||
assert_match /rm -rf app-redis/, output
|
||||
|
||||
assert_match /docker logout/, output
|
||||
|
||||
@@ -140,7 +140,7 @@ class CommandsAccessoryTest < ActiveSupport::TestCase
|
||||
|
||||
test "remove image" do
|
||||
assert_equal \
|
||||
"docker image prune --all --force --filter label=service=app-mysql",
|
||||
"docker image rm --force private.registry/mysql:8.0",
|
||||
new_command(:mysql).remove_image.join(" ")
|
||||
end
|
||||
|
||||
|
||||
@@ -197,12 +197,6 @@ class CommandsAppTest < ActiveSupport::TestCase
|
||||
new_command.current_running_version.join(" ")
|
||||
end
|
||||
|
||||
test "most_recent_version_from_available_images" do
|
||||
assert_equal \
|
||||
"docker image ls --format \"{{.Tag}}\" dhh/app | head -n 1",
|
||||
new_command.most_recent_version_from_available_images.join(" ")
|
||||
end
|
||||
|
||||
test "list_containers" do
|
||||
assert_equal \
|
||||
"docker container ls --all --filter label=service=app",
|
||||
|
||||
Reference in New Issue
Block a user