Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rcrichton committed Sep 27, 2024
1 parent f198486 commit ec0184e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
1 change: 0 additions & 1 deletion cli/src/core/generate/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func Test_createFileFromTemplate(t *testing.T) {
generatePackSpec := core.GeneratePackageSpec{
Id: "test-package",
Name: "Test Package",
Stack: "test-stack",
Image: "test/image",
Description: "A package for testing",
Type: "infrastructure",
Expand Down
15 changes: 5 additions & 10 deletions cli/src/features/test-package/swarm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ declare ACTION=""
declare MODE=""
declare COMPOSE_FILE_PATH=""
declare UTILS_PATH=""
declare SERVICE_NAMES=()
declare STACK="test-package"

function init_vars() {
ACTION=$1
Expand All @@ -17,15 +17,11 @@ function init_vars() {

UTILS_PATH="${COMPOSE_FILE_PATH}/../utils"

SERVICE_NAMES=(
"test-package"
)

readonly ACTION
readonly MODE
readonly COMPOSE_FILE_PATH
readonly UTILS_PATH
readonly SERVICE_NAMES
readonly STACK
}

# shellcheck disable=SC1091
Expand All @@ -44,16 +40,15 @@ function initialize_package() {
fi

(
docker::deploy_service "${COMPOSE_FILE_PATH}" "$package_dev_compose_filename"
docker::deploy_sanity "${SERVICE_NAMES[@]}"
docker::deploy_service $STACK "${COMPOSE_FILE_PATH}" "docker-compose.yml" "$package_dev_compose_filename"
) || {
log error "Failed to deploy package"
exit 1
}
}

function destroy_package() {
docker::service_destroy "${SERVICE_NAMES[@]}"
docker::stack_destroy $STACK
}

main() {
Expand All @@ -67,7 +62,7 @@ main() {
elif [[ "${ACTION}" == "down" ]]; then
log info "Scaling down package"

docker::scale_services_down "${SERVICE_NAMES[@]}"
docker::scale_services $STACK 0
elif [[ "${ACTION}" == "destroy" ]]; then
log info "Destroying package"

Expand Down
1 change: 0 additions & 1 deletion cli/src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/cucumber/godog v0.12.5
github.com/docker/cli v20.10.21+incompatible
github.com/docker/docker v20.10.21+incompatible
github.com/iancoleman/strcase v0.2.0
github.com/luno/jettison v0.0.0-20221009180414-a591f4833ce4
github.com/manifoldco/promptui v0.9.0
github.com/spf13/cobra v1.6.1
Expand Down
2 changes: 0 additions & 2 deletions cli/src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,6 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0=
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
Expand Down

0 comments on commit ec0184e

Please sign in to comment.