From 44f854f1f373312106e24020cf15b0578bbed59a Mon Sep 17 00:00:00 2001 From: Johnny Brenes <103782746+JBrenesSimpat@users.noreply.github.com> Date: Thu, 13 Jun 2024 08:18:28 -0600 Subject: [PATCH] [PERF-319] Run Volume Test on github Action (#97) * Volume Test in VM * update volume test name * error cannot find comparison folder * on workflow dispatch * comments * update name for the action * workflow permissions update for PERF-324 --------- Co-authored-by: Vinaya Mayya --- .github/workflows/run_volume_test.yml | 37 +++++++++++++++++++ .../edfi_perf_test_analysis/ui_helpers.py | 10 ++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/run_volume_test.yml diff --git a/.github/workflows/run_volume_test.yml b/.github/workflows/run_volume_test.yml new file mode 100644 index 00000000..27b7bdb2 --- /dev/null +++ b/.github/workflows/run_volume_test.yml @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: Apache-2.0 +# Licensed to the Ed-Fi Alliance under one or more agreements. +# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. +# See the LICENSE and NOTICES files in the project root for more information. + +name: Run Volume Test +on: + workflow_dispatch: + +permissions: read-all + +env: + AzureTestVmUsername: ${{ secrets.AZURE_TEST_VM_USER_NAME }} + AzureTestVmPassword: ${{ secrets.AZURE_TEST_VM_PASSWORD }} + +jobs: + volume-test: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + + - name: Execute Test Runner + if: ${{ env.AzureTestVmUsername != '' && env.AzureTestVmPassword != '' }} + shell: powershell + working-directory: ./eng/ + run: | + . $env:GITHUB_WORKSPACE/eng/AzureTestLab.ps1 + Invoke-TestRunnerFromTeamCity volume + + - name: Upload Package + if: success() + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: TestResults + path: ${{ github.workspace }}/eng/artifacts/ diff --git a/src/perf-test-analysis/edfi_perf_test_analysis/ui_helpers.py b/src/perf-test-analysis/edfi_perf_test_analysis/ui_helpers.py index 43d57517..995e5682 100644 --- a/src/perf-test-analysis/edfi_perf_test_analysis/ui_helpers.py +++ b/src/perf-test-analysis/edfi_perf_test_analysis/ui_helpers.py @@ -100,7 +100,15 @@ def get_result_directory() -> Tuple[str, str]: index = -2 # find compare_dir with same type of test results as in the result_dir while not os.path.exists(os.path.join(time_sorted_list[index], result_file)): + # IndexError: list index out of range + if abs(index - 1) > len(time_sorted_list): + break index = index - 1 - compare_dir = time_sorted_list[index] + + # when it is the first execution of the test there is nothing to compare against + if not os.path.exists(os.path.join(time_sorted_list[index], result_file)): + compare_dir = result_dir + else: + compare_dir = time_sorted_list[index] return (result_dir, compare_dir)