Skip to content

Commit db695e0

Browse files
committed
Test setting the Key
Signed-off-by: Fabricio Aguiar <fabricio.aguiar@gmail.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
1 parent a1efe95 commit db695e0

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ test-lseval-troubleshooting: ## DISABLED: LSEval troubleshooting (uncomment Make
113113
test-cluster-updates: ## Run cluster-updates evaluation (18 conversations, 35 evaluations) - requires running OLS server with OpenAI keys
114114
@echo "Running cluster-updates evaluation..."
115115
@echo "Reports will be written to ${ARTIFACT_DIR}"
116-
uv run --extra lseval --extra evaluation pytest tests/e2e/evaluation -vv -s --durations=0 -o junit_suite_name="${SUITE_ID}" --junit-prefix="${SUITE_ID}" --junit-xml="${ARTIFACT_DIR}/junit_e2e_${SUITE_ID}.xml" \
116+
OPENAI_API_KEY="${OPENAI_API_KEY}" uv run --extra lseval --extra evaluation pytest tests/e2e/evaluation -vv -s --durations=0 -o junit_suite_name="${SUITE_ID}" --junit-prefix="${SUITE_ID}" --junit-xml="${ARTIFACT_DIR}/junit_e2e_${SUITE_ID}.xml" \
117117
--eval_out_dir ${ARTIFACT_DIR} -m cluster_updates
118118

119119
coverage-report: unit-tests-coverage-report integration-tests-coverage-report ## Export coverage reports into interactive HTML

tests/scripts/test-evaluation.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ chmod +x operator-sdk_${OS}_${ARCH} && mv operator-sdk_${OS}_${ARCH} $HOME/.loca
2828
export PATH=$HOME/.local/bin:$PATH
2929
operator-sdk version
3030

31+
# Export OpenAI key for judge LLM in evaluation tests (cluster-updates, lseval)
32+
if [ -n "${OPENAI_PROVIDER_KEY_PATH:-}" ] && [ -f "$OPENAI_PROVIDER_KEY_PATH" ]; then
33+
export OPENAI_API_KEY=$(cat "$OPENAI_PROVIDER_KEY_PATH")
34+
fi
35+
3136
function run_suites() {
3237
local rc=0
3338

0 commit comments

Comments
 (0)