Skip to content

Commit

Permalink
Fixed static code analysis issues
Browse files Browse the repository at this point in the history
  • Loading branch information
flounderpinto committed Dec 14, 2023
1 parent 322d9a0 commit 87beb54
Showing 1 changed file with 66 additions and 66 deletions.
132 changes: 66 additions & 66 deletions test/unit/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,28 @@ function oneTimeTearDown()

testSingleArgs()
{
local REGISTRY="docker-registry"
local REPO="docker-repo"
local BUILD_CONTEXT="build-context-dir"
local DOCKERFILE="dockerfile"
local GIT_DIR="git-dir"
local PLATFORM="target"
local TAG="tag"
local BUILD_ARG="build-arg"
local ARGS="--arg on"
local E="docker-registry"
local R="docker-repo"
local D="build-context-dir"
local F="dockerfile"
local G="git-dir"
local P="target"
local T="tag"
local B="build-arg"
local A="--arg on"

rm -f "$OUTPUT_FILE"

stdout=$(dockerBuild \
-e "$REGISTRY" \
-r "$REPO" \
-d "$BUILD_CONTEXT" \
-f "$DOCKERFILE" \
-g "$GIT_DIR" \
-p "$PLATFORM" \
-t "$TAG" \
-b "$BUILD_ARG" \
-a "$ARGS")
-e "$E" \
-r "$R" \
-d "$D" \
-f "$F" \
-g "$G" \
-p "$P" \
-t "$T" \
-b "$B" \
-a "$A")
echo "$stdout"
buildCmd=$(<"$OUTPUT_FILE")
expected=$(<"$SCRIPT_DIR/expected/singleArgs")
Expand All @@ -87,36 +87,36 @@ testSingleArgs()

testMultipleArgs()
{
local REGISTRY="docker-registry"
local REPO="docker-repo"
local BUILD_CONTEXT="build-context-dir"
local DOCKERFILE="dockerfile"
local GIT_DIR="git-dir"
local PLATFORM1="platform1"
local PLATFORM2="platform2"
local TAG1="tag1"
local TAG2="tag2"
local BUILD_ARG1="build-arg1"
local BUILD_ARG2="build-arg2"
local ARG1="--arg1 on"
local ARG2="--arg2 off"
local E="docker-registry"
local R="docker-repo"
local D="build-context-dir"
local F="dockerfile"
local G="git-dir"
local P1="platform1"
local P2="platform2"
local T1="tag1"
local T2="tag2"
local B1="build-arg1"
local B2="build-arg2"
local A1="--arg1 on"
local A2="--arg2 off"

rm -f "$OUTPUT_FILE"

stdout=$(dockerBuild \
-e "$REGISTRY" \
-r "$REPO" \
-d "$BUILD_CONTEXT" \
-f "$DOCKERFILE" \
-g "$GIT_DIR" \
-p "$PLATFORM1" \
-p "$PLATFORM2" \
-t "$TAG1" \
-t "$TAG2" \
-b "$BUILD_ARG1" \
-b "$BUILD_ARG2" \
-a "$ARG1" \
-a "$ARG2")
-e "$E" \
-r "$R" \
-d "$D" \
-f "$F" \
-g "$G" \
-p "$P1" \
-p "$P2" \
-t "$T1" \
-t "$T2" \
-b "$B1" \
-b "$B2" \
-a "$A1" \
-a "$A2")
echo "$stdout"
buildCmd=$(<"$OUTPUT_FILE")
expected=$(<"$SCRIPT_DIR/expected/multipleArgs")
Expand All @@ -126,32 +126,32 @@ testMultipleArgs()

testMultipleArgsCommaSeparated()
{
local REGISTRY="docker-registry"
local REPO="docker-repo"
local BUILD_CONTEXT="build-context-dir"
local DOCKERFILE="dockerfile"
local GIT_DIR="git-dir"
local PLATFORM="platform1,platform2"
local TAG1="tag1"
local TAG2="tag2"
local BUILD_ARG1="build-arg1"
local BUILD_ARG2="build-arg2"
local ARG="--arg1 on --arg2 off"
local E="docker-registry"
local R="docker-repo"
local D="build-context-dir"
local F="dockerfile"
local G="git-dir"
local P="platform1,platform2"
local T1="tag1"
local T2="tag2"
local B1="build-arg1"
local B2="build-arg2"
local A="--arg1 on --arg2 off"

rm -f "$OUTPUT_FILE"

stdout=$(dockerBuild \
-e "$REGISTRY" \
-r "$REPO" \
-d "$BUILD_CONTEXT" \
-f "$DOCKERFILE" \
-g "$GIT_DIR" \
-p "$PLATFORM" \
-t "$TAG1" \
-t "$TAG2" \
-b "$BUILD_ARG1" \
-b "$BUILD_ARG2" \
-a "$ARG")
-e "$E" \
-r "$R" \
-d "$D" \
-f "$F" \
-g "$G" \
-p "$P" \
-t "$T1" \
-t "$T2" \
-b "$B1" \
-b "$B2" \
-a "$A")
echo "$stdout"
buildCmd=$(<"$OUTPUT_FILE")
expected=$(<"$SCRIPT_DIR/expected/multipleArgs")
Expand Down

0 comments on commit 87beb54

Please sign in to comment.