forked from awsdocs/aws-doc-sdk-examples
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·30 lines (26 loc) · 784 Bytes
/
run_tests.sh
File metadata and controls
executable file
·30 lines (26 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# Recursive function to navigate sub-directories
run_gradle_tests() {
for dir in "$1"/*/; do
if [[ -f "$dir/build.gradle.kts" ]]; then
echo "Running gradle build test in $dir"
# add integration test tag
(cd "$dir" && gradle test)
fi
if [[ -d "$dir" ]]; then
run_gradle_tests "$dir" # Recursively call function for sub-directories
fi
done
}
# Root directory
root_dir="/kotlin/services"
# Error if the root directory does not exist
if [[ ! -d "$root_dir" ]]; then
echo "Root directory $root_dir does not exist!"
exit 1
fi
echo "Starting gradle tests..."
run_gradle_tests "$root_dir"
echo "gradle tests completed."