Skip to content

Commit

Permalink
remove test_replicated_no_running_tasks_rollback. --detach updating w…
Browse files Browse the repository at this point in the history
…on't fail, thus no rollback.
  • Loading branch information
shizunge committed Jun 29, 2023
1 parent 35f81f9 commit 0f250e5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
1 change: 0 additions & 1 deletion tests/run_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ main() {
test_jobs_UPDATE_JOBS_on "${IMAGE_WITH_TAG}"
test_MANIFEST_INSPECT_off "${IMAGE_WITH_TAG}"
test_replicated_no_running_tasks "${IMAGE_WITH_TAG}"
test_replicated_no_running_tasks_rollback "${IMAGE_WITH_TAG}"
test_timeout_rollback "${IMAGE_WITH_TAG}"
test_rollback_failed "${IMAGE_WITH_TAG}"
test_ROLLBACK_ON_FAILURE_off "${IMAGE_WITH_TAG}"
Expand Down
42 changes: 0 additions & 42 deletions tests/test_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -424,48 +424,6 @@ test_replicated_no_running_tasks() {
return 0
}

test_replicated_no_running_tasks_rollback() {
# Add "--detach=true" when there is no running tasks.
# https://github.com/docker/cli/issues/627
# To test it is ok to add the additional options to docker service update --rollback.
local IMAGE_WITH_TAG="${1}"

test_start "${FUNCNAME[0]}"
local SERVICE_NAME STDOUT
SERVICE_NAME="gantry-test-$(date +%s)"
build_and_push_test_image "${IMAGE_WITH_TAG}"
start_service "${SERVICE_NAME}" "${IMAGE_WITH_TAG}"
docker service update --quiet --replicas=0 "${SERVICE_NAME}"
wait_zero_running_tasks "${SERVICE_NAME}"
build_and_push_test_image "${IMAGE_WITH_TAG}"

export GANTRY_SERVICES_FILTERS="name=${SERVICE_NAME}"
# Assume service update won't be done within 1 second.
export GANTRY_UPDATE_TIMEOUT_SECONDS=1
STDOUT=$(run_gantry "${FUNCNAME[0]}" 2>&1 | tee /dev/tty)

expect_message "${STDOUT}" "Add option.*--detach=true"
expect_message "${STDOUT}" "Add option.*--replicas=0"
expect_no_message "${STDOUT}" "${SKIP_UPDATING_SERVICE}.*${SERVICE_NAME}"
expect_no_message "${STDOUT}" "${SERVICE_NAME}.*${NO_NEW_IMAGE}"
expect_no_message "${STDOUT}" "${SERVICE_NAME}.*${UPDATED}"
expect_no_message "${STDOUT}" "${SERVICE_NAME}.*${NO_UPDATES}"
expect_message "${STDOUT}" "${ROLLING_BACK}.*${SERVICE_NAME}"
expect_no_message "${STDOUT}" "${FAILED_TO_ROLLBACK}.*${SERVICE_NAME}"
expect_message "${STDOUT}" "${ROLLED_BACK}.*${SERVICE_NAME}"
expect_message "${STDOUT}" "${NO_SERVICES_UPDATED}"
expect_no_message "${STDOUT}" "${NUM_SERVICES_UPDATED}"
expect_message "${STDOUT}" "${NO_IMAGES_TO_REMOVE}"
expect_no_message "${STDOUT}" "${REMOVING_NUM_IMAGES}"
expect_no_message "${STDOUT}" "${SKIP_REMOVING_IMAGES}"
expect_no_message "${STDOUT}" "${REMOVED_IMAGE}.*${IMAGE_WITH_TAG}"
expect_no_message "${STDOUT}" "${FAILED_TO_REMOVE_IMAGE}.*${IMAGE_WITH_TAG}"

stop_service "${SERVICE_NAME}"
test_end "${FUNCNAME[0]}"
return 0
}

test_timeout_rollback() {
local IMAGE_WITH_TAG="${1}"

Expand Down

0 comments on commit 0f250e5

Please sign in to comment.