Skip to content

Commit 1eebca0

Browse files
committed
ci: add back bin/test-unit lost in merge
- simplify integration script
1 parent b22ce44 commit 1eebca0

2 files changed

Lines changed: 23 additions & 19 deletions

File tree

src/config-server/bin/test-integration

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,12 @@ set -eu -o pipefail
33

44
config_server_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
55

6-
run_tests (){
7-
export DB=$1
8-
echo -e "\n\nRunning Integration tests for $DB\n\n"
6+
export DB="${1:-"memory"}"
97

10-
pushd "${config_server_dir}"
11-
go run github.com/onsi/ginkgo/v2/ginkgo run -r --race integration
12-
popd
13-
}
8+
echo -e "\n Running Integration tests with datastore '${DB}'..."
149

15-
case "${1:-}" in
16-
memory )
17-
run_tests memory ;;
18-
mysql )
19-
run_tests mysql ;;
20-
postgresql )
21-
run_tests postgresql ;;
22-
* )
23-
echo "Usage: ${0} {mysql|postgresql|memory}"
24-
exit 1
25-
;;
26-
esac
10+
(
11+
cd "${config_server_dir}"
12+
go run github.com/onsi/ginkgo/v2/ginkgo run -r --race --trace \
13+
integration
14+
)

src/config-server/bin/test-unit

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
set -eu -o pipefail
3+
4+
config_server_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
5+
6+
[ -z "${SKIP_LINT:-}" ] && "${config_server_dir}/bin/lint"
7+
8+
echo -e "\n Running unit tests..."
9+
10+
(
11+
cd "${config_server_dir}"
12+
13+
go run github.com/onsi/ginkgo/v2/ginkgo run -r --race --trace \
14+
--skip-package="integration" \
15+
"$@"
16+
)

0 commit comments

Comments
 (0)