Skip to content

Commit 672ad24

Browse files
authored
Merge branch 'dev' into anandhu-eng-patch-1
2 parents accac50 + 941fd51 commit 672ad24

14 files changed

Lines changed: 2289 additions & 190 deletions

.github/workflows/ai-pr-review.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ jobs:
1717
uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
20+
ref: ${{ github.event.pull_request.base.ref }}
2021

2122
- name: Install dependencies
2223
run: |
2324
pip install requests jq
2425
26+
- name: Fetch PR head
27+
run: |
28+
git fetch origin ${{ github.event.pull_request.head.sha }}
29+
2530
- name: Get incremental diff
2631
id: diff
2732
run: |

.github/workflows/test-installer-curl.yml

Lines changed: 516 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/test-mlc-core-actions.yaml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,116 @@ jobs:
220220
mlc rm repo mlcommons@mlperf-automations -f
221221
mlcr detect,cpu -j
222222
223+
- name: Test 26 - Test reindex command and verify index files are updated
224+
run: |
225+
INDEX_SCRIPT="${HOME}/MLC/repos/index_script.json"
226+
INDEX_CACHE="${HOME}/MLC/repos/index_cache.json"
227+
INDEX_EXPERIMENT="${HOME}/MLC/repos/index_experiment.json"
228+
229+
# Store initial modification times
230+
if [ -f "$INDEX_SCRIPT" ]; then
231+
BEFORE_SCRIPT=$(stat -c %Y "$INDEX_SCRIPT" 2>/dev/null || stat -f %m "$INDEX_SCRIPT" 2>/dev/null)
232+
fi
233+
if [ -f "$INDEX_CACHE" ]; then
234+
BEFORE_CACHE=$(stat -c %Y "$INDEX_CACHE" 2>/dev/null || stat -f %m "$INDEX_CACHE" 2>/dev/null)
235+
fi
236+
if [ -f "$INDEX_EXPERIMENT" ]; then
237+
BEFORE_EXPERIMENT=$(stat -c %Y "$INDEX_EXPERIMENT" 2>/dev/null || stat -f %m "$INDEX_EXPERIMENT" 2>/dev/null)
238+
fi
239+
240+
sleep 1
241+
242+
# Test reindex all
243+
mlc reindex
244+
245+
# Verify all index files were updated
246+
if [ -f "$INDEX_SCRIPT" ]; then
247+
AFTER_SCRIPT=$(stat -c %Y "$INDEX_SCRIPT" 2>/dev/null || stat -f %m "$INDEX_SCRIPT" 2>/dev/null)
248+
if [ "$BEFORE_SCRIPT" = "$AFTER_SCRIPT" ]; then
249+
echo "index_script.json was not updated after 'mlc reindex'. Exiting with failure."
250+
exit 1
251+
fi
252+
fi
253+
254+
sleep 1
255+
BEFORE_SCRIPT=$(stat -c %Y "$INDEX_SCRIPT" 2>/dev/null || stat -f %m "$INDEX_SCRIPT" 2>/dev/null)
256+
257+
# Test reindex specific target
258+
mlc reindex script
259+
260+
AFTER_SCRIPT=$(stat -c %Y "$INDEX_SCRIPT" 2>/dev/null || stat -f %m "$INDEX_SCRIPT" 2>/dev/null)
261+
if [ "$BEFORE_SCRIPT" = "$AFTER_SCRIPT" ]; then
262+
echo "index_script.json was not updated after 'mlc reindex script'. Exiting with failure."
263+
exit 1
264+
fi
265+
266+
# Test other reindex commands
267+
mlc reindex all
268+
mlc reindex cache
269+
mlc reindex experiment
270+
271+
- name: Test 27 - Test index handling when script/cache/repo is manually deleted
272+
run: |
273+
# Add a test script
274+
mlc add script test-delete-script --tags=test,delete,temp
275+
276+
# Get the actual script path from find command
277+
SCRIPT_PATH=$(mlc find script test-delete-script -p 2>&1)
278+
echo "Script path: $SCRIPT_PATH"
279+
280+
if [ -z "$SCRIPT_PATH" ]; then
281+
echo "Script was not found after adding. Exiting with failure."
282+
exit 1
283+
fi
284+
285+
# Manually delete the script
286+
if [ -d "$SCRIPT_PATH" ]; then
287+
rm -rf "$SCRIPT_PATH"
288+
echo "Manually deleted script at $SCRIPT_PATH"
289+
else
290+
echo "Script directory not found at $SCRIPT_PATH. Exiting with failure."
291+
exit 1
292+
fi
293+
294+
# Verify the deleted script is no longer in the index
295+
# The find command will automatically trigger index rebuild and detect the deletion
296+
FIND_RESULT=$(mlc find script test-delete-script -p 2>/dev/null)
297+
if [ -n "$FIND_RESULT" ]; then
298+
echo "ERROR: Deleted script still found in index. Found: $FIND_RESULT"
299+
exit 1
300+
fi
301+
302+
echo "Script deletion test passed successfully"
303+
304+
# Test with cache: run a script to create cache, then delete it manually
305+
mlc run script --tags=detect,os --quiet
306+
307+
# Find and delete a cache entry
308+
CACHE_PATH=$(mlc find cache --tags=detect,os -p 2>/dev/null | head -1)
309+
if [ -n "$CACHE_PATH" ] && [ -d "$CACHE_PATH" ]; then
310+
echo "Found cache at: $CACHE_PATH"
311+
312+
# Get the cache directory name for later verification
313+
CACHE_DIR_NAME=$(basename "$CACHE_PATH")
314+
315+
rm -rf "$CACHE_PATH"
316+
echo "Manually deleted cache at $CACHE_PATH"
317+
318+
# Verify the deleted cache is no longer in the index
319+
# Check if the cache directory name appears in any found caches
320+
if mlc find cache --tags=detect,os -p 2>/dev/null | grep -q "$CACHE_DIR_NAME"; then
321+
echo "ERROR: Deleted cache directory still found in index."
322+
echo "Deleted cache: $CACHE_PATH"
323+
echo "Found caches:"
324+
mlc find cache --tags=detect,os -p 2>/dev/null
325+
exit 1
326+
fi
327+
328+
echo "Cache deletion test passed successfully"
329+
else
330+
echo "No cache found to test deletion"
331+
fi
332+
223333
test_mlc_access_core_actions:
224334

225335
runs-on: ${{ matrix.os }}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.18
1+
1.1.22

0 commit comments

Comments
 (0)