relate icon indicating copy to clipboard operation
relate copied to clipboard

relate test-code conflicts between files

Open yslan opened this issue 1 year ago • 2 comments

I was in the middle of setting up the CI test following the script

run_yamls=()
for i in $( git grep --name-only PythonCodeQuestion *.yml ) ; do
    # FIXME: https://github.com/inducer/relate/issues/951
    if ! grep data_files "$i" > /dev/null ; then
        run_yamls+=("$i")
    fi
done

relate test-code "${run_yamls[@]}"

This ends up reusing the module from previous yml. To be specific, np.linalg.qr = not_allowed is set inside

problem-bank/homework-problems/eigenvalue/code-qr-iteration-givens.yml

Then, when running the next file, code-qr-iteration-shift.yml, the call of np.linalg.qr triggers the assertion error.

yslan avatar Jan 17 '25 21:01 yslan

Potentially, we could fork before each test? This avoids paying for the interpreter startup cost repeatedly.

I don't know that there is a reliable way to reset a monkeypatched module to its original state. reload comes to mind, but what modules would one reload?

inducer avatar Jan 17 '25 21:01 inducer

fork would also offer a way to parallelize runs.

inducer avatar Jan 17 '25 21:01 inducer