From 2704bcee5ef86eb3da75139a08f618135f66d754 Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Sun, 16 Jul 2023 07:26:36 -0700 Subject: [PATCH] Allow change location of reports (#115) Signed-off-by: Merwane Hamadi --- .github/workflows/ci.yml | 7 +++---- agbenchmark/utils.py | 6 +++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 907c2126..9d4769e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,6 @@ jobs: if: success() || failure() tests: - if: github.event_name != 'pull_request' || matrix.cache-enabled == false name: "${{ matrix.agent-name }} (Cache: ${{ matrix.cache-enabled }})" runs-on: ubuntu-latest timeout-minutes: 10 @@ -161,12 +160,12 @@ jobs: REQUESTS_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt HELICONE_CACHE_ENABLED: ${{ matrix.cache-enabled }} HELICONE_PROPERTY_AGENT: ${{ matrix.agent-name }} + REPORT_LOCATION: ${{ matrix.cache-enabled == true && format('../../../benchmark_runs/{0}', matrix.agent-name) || '.' }} - name: Upload reports if: always() uses: actions/upload-artifact@v3 with: - name: - "${{ matrix.agent-name }} (Cache ${{ matrix.cache-enabled }})" - path: agent/${{ matrix.agent-name }}/agbenchmark + name: ${{ matrix.agent-name }} + path: benchmark_runs/${{ matrix.agent-name }} diff --git a/agbenchmark/utils.py b/agbenchmark/utils.py index 1174e89b..506c4884 100644 --- a/agbenchmark/utils.py +++ b/agbenchmark/utils.py @@ -1,5 +1,6 @@ # radio charts, logs, helper functions for tests, anything else relevant. import glob +import os import re from datetime import datetime from pathlib import Path @@ -9,7 +10,10 @@ from agbenchmark.challenges.define_task_types import DIFFICULTY_MAP, DifficultyL def calculate_info_test_path(benchmarks_folder_path: Path) -> str: - INFO_TESTS_PATH = benchmarks_folder_path / "reports" + + INFO_TESTS_PATH = ( + benchmarks_folder_path / os.getenv("REPORT_LOCATION", ".") / "reports" + ) if not INFO_TESTS_PATH.exists(): INFO_TESTS_PATH.mkdir(parents=True, exist_ok=True)