-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
specify package name in go file and add run test script
- Loading branch information
1 parent
7a24a91
commit 4f11205
Showing
7 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package connector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package connector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package connector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
SCRIPT_DIR=$(dirname "$BASH_SOURCE") | ||
ROOT_PROJECT_DIR=$SCRIPT_DIR/.. | ||
|
||
cd $ROOT_PROJECT_DIR | ||
|
||
BLUE='\033[0;34m' | ||
NC='\033[0m' | ||
|
||
# Default flag values | ||
RUN_UNIT_TESTS=true | ||
RUN_INTEGRATION_TESTS=true | ||
|
||
# Parse arguments | ||
while getopts "ui" opt; do | ||
case ${opt} in | ||
u) | ||
RUN_UNIT_TESTS=true | ||
RUN_INTEGRATION_TESTS=false | ||
;; | ||
i) | ||
RUN_UNIT_TESTS=false | ||
RUN_INTEGRATION_TESTS=true | ||
;; | ||
*) | ||
echo "Usage: $0 [-u] (for unit tests) [-i] (for integration tests)" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
echo "#####################################################################################################" | ||
echo -e "$BLUE INFO: $NC About to run tests based on the flags" | ||
|
||
if [ "$RUN_UNIT_TESTS" = true ]; then | ||
echo -e "$BLUE INFO: $NC Running unit tests..." | ||
go test ./test/unit/... | ||
fi | ||
|
||
if [ "$RUN_INTEGRATION_TESTS" = true ]; then | ||
echo -e "$BLUE INFO: $NC Running integration tests..." | ||
go test ./test/integration | ||
fi | ||
|
||
cd $SCRIPT_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package connector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package connector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package connector |