File size: 701 Bytes
2d13eb2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # !/bin/bash
eval "$(conda shell.bash hook)"
conda activate test_common1
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Define the target directory
TARGET_DIR="${SCRIPT_DIR}/conformal-factual-lm"
# Copy files to target directory
cp "${SCRIPT_DIR}/canonical.py" "${TARGET_DIR}/src/."
cp "${SCRIPT_DIR}/test.py" "${TARGET_DIR}/src/."
# Change to target directory and run the script
cd "${TARGET_DIR}/src/." || exit
# Set PYTHONPATH and run pytest
PYTHONPATH="${TARGET_DIR}" pytest --timeout=10 test.py --junitxml="${SCRIPT_DIR}/pytest_report/report.xml" \
--cov="canonical" --cov-report=json:"${SCRIPT_DIR}/jsoncov"
rm "${TARGET_DIR}/src/canonical.py"
rm "${TARGET_DIR}/src/test.py" |