Skip to content

Commit

Permalink
Merge pull request #216 from jembi/PLAT-663-run-tests-sh-bug-fix
Browse files Browse the repository at this point in the history
PLAT-663 run-tests.sh package deduplication
  • Loading branch information
bradsawadye authored Feb 13, 2023
2 parents 5d6bbe0 + fa95e7a commit c6cb4ce
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,31 @@ CHANGED_FILES=($@)

cd ../../test/cucumber/ || exit

if [[ ${#CHANGED_FILES[@]} -eq 0 ]] || [[ "${CHANGED_FILES[*]}" == *"utils"* ]]; then
declare -A changed_packages
for package in "${CHANGED_FILES[@]}"; do
if [[ $package == *"features/cluster-mode"* ]]; then
changed_packages["features/cluster-mode"]="true"

elif [[ $package == *"features/single-mode"* ]]; then
changed_packages["features/single-mode"]="true"

else
IFS='/' read -r -a split_string <<<"$package"
changed_packages["${split_string[0]}"]="true"

fi
done

if [[ ${#changed_packages[@]} -eq 0 ]] || [[ "${!changed_packages[*]}" == *"utils"* ]]; then
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:"$NODE_MODE"
elif [[ "${CHANGED_FILES[*]}" == *"features/single-mode"* ]] && [[ $NODE_MODE == "single" ]]; then
elif [[ "${!changed_packages[*]}" == *"features/single-mode"* ]] && [[ $NODE_MODE == "single" ]]; then
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:single
elif [[ "${CHANGED_FILES[*]}" == *"features/cluster-mode"* ]] && [[ $NODE_MODE == "cluster" ]]; then
elif [[ "${!changed_packages[*]}" == *"features/cluster-mode"* ]] && [[ $NODE_MODE == "cluster" ]]; then
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:cluster
elif [[ "${!changed_packages[*]}" == *"infrastructure"* ]]; then
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:"$NODE_MODE"
else
for folder_name in "${CHANGED_FILES[@]}"; do
for folder_name in "${!changed_packages[@]}"; do
echo "$folder_name was changed"

if [[ $folder_name == *"clickhouse"* ]]; then
Expand Down

0 comments on commit c6cb4ce

Please sign in to comment.