Skip to content

Commit

Permalink
test the batch chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
mauvais2 committed Jan 15, 2025
1 parent 1491d58 commit eecc8f8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions atomsci/ddm/test/integrative/integrative_batch_chunk_tests
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#!/bin/bash

set -e
Expand All @@ -24,9 +25,14 @@ calculate_hash() {
# Function to determine if a folder belongs to the selected subset
belongs_to_subset() {
local folder="$1"
echo "folder $folder"
local hash=$(calculate_hash "$folder")
local hash_decimal=$((0x${hash:0:8}))
local subset=$((hash_decimal % num_subsets))
echo "hash $hash"
echo "hash_decimal $hash_decimal"
echo "subset $subset"
echo "subset_index $subset_index"
if [ "$subset" -eq "$subset_index" ]; then
return 0 # Folder belongs to the subset
else
Expand All @@ -40,8 +46,8 @@ for folder in "${folders[@]}"; do
file=($folder/test_*.py)
if [[ -f "$file" && "$folder" != "__pycache__/" ]]; then
cd "$folder"
echo "Testing $folder"
pytest --capture=sys --capture=fd --cov=atomsci -vv
echo "Testing $file $folder"
echo "pytest --capture=sys --capture=fd --cov=atomsci -vv"
cd ..
else
echo "Skipping folder: $folder. Not a test directory."
Expand Down

0 comments on commit eecc8f8

Please sign in to comment.