Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Oct 31, 2024
1 parent 9c52661 commit bfb6ad9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,32 +67,32 @@ jobs:
# Base path for directories to check
base_dir="src/test/resources/projects/state-example/build/ois/distribution"
# Define directory names with required minimum count (format: "dir_name:min_count")
# Define directory names with required minimum count (format: "dir_name:exact_count")
dir_requirements=("Html:1" "Desktop:0")
# Iterate through each directory name and check conditions
for entry in "${dir_requirements[@]}"; do
# Split entry into name and min_count using parameter expansion
# Split entry into name and exact_count using parameter expansion
dir_name="${entry%%:*}"
min_count="${entry##*:}"
dir_path="$base_dir/dir_name"
exact_count="${entry##*:}"
dir_path="$base_dir/$dir_name"
# Check if the directory exists
if [ -d "$dir_path" ]; then
# Count files and directories within the current directory
actual_count=$(find "$dir_path" -type f -or -type d | wc -l) - 1
# Check if the actual count meets or exceeds the minimum required count
if [ "$actual_count" -ge "$min_count" ]; then
echo "Directory $dir_path contains sufficient items ($actual_count found, minimum required: $min_count):"
if [ "$actual_count" -eq "$exact_count" ]; then
echo "Directory $dir_path has the exact required count ($actual_count items):"
# List directory contents based on the OS
if [[ ${{ matrix.os }} == "windows-latest" ]]; then
dir "$dir_path"
else
ls -la "$dir_path"
fi
else
echo "Directory $dir_path does not meet the required count. Expected at least $min_count, but found $actual_count." && exit 1
echo "Directory $dir_path does not meet the exact required count. Expected $exact_count, but found $actual_count." && exit 1
fi
else
echo "Directory does not exist: $dir_path" && exit 1
Expand Down

0 comments on commit bfb6ad9

Please sign in to comment.