From 23e9c3216c782e904aaa9126dd9157b731977587 Mon Sep 17 00:00:00 2001 From: Stephane Struzik <34556337+sstruzik@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:54:47 +0100 Subject: [PATCH] Fix test as Ri moved to input (#185) * Fix test as Ri moved to input * check code is running * Update script branch if set on inputs * remove check commit * fix * Try using piwind branch * try agian --------- Co-authored-by: Sam Gamble --- .github/workflows/run_mdk.yml | 5 ++++- tests/run_mdk.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_mdk.yml b/.github/workflows/run_mdk.yml index bc4ce1cb..60efcc10 100644 --- a/.github/workflows/run_mdk.yml +++ b/.github/workflows/run_mdk.yml @@ -58,7 +58,7 @@ on: type: string env: - SCRIPT_BRANCH: 'master' + SCRIPT_BRANCH: 'main' PIWIND_BRANCH: ${{ github.ref }} MDK_BRANCH: 'main' MDK_RUN: 'ri' @@ -87,6 +87,7 @@ jobs: - name: Set inputs run: | [[ -z "${{ inputs.piwind_branch }}" ]] || echo "PIWIND_BRANCH=${{ inputs.piwind_branch }}" >> $GITHUB_ENV + [[ -z "${{ inputs.piwind_branch }}" ]] || echo "SCRIPT_BRANCH=${{ inputs.piwind_branch }}" >> $GITHUB_ENV [[ -z "${{ inputs.mdk_branch }}" ]] || echo "MDK_BRANCH=${{ inputs.mdk_branch }}" >> $GITHUB_ENV [[ -z "${{ inputs.mdk_run_type }}" ]] || echo "MDK_RUN=${{ inputs.mdk_run_type }}" >> $GITHUB_ENV @@ -95,6 +96,7 @@ jobs: run: | echo "MDK_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV echo "PIWIND_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV + echo "SCRIPT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV - name: Update Params (Pull Request) if: github.event_name == 'pull_request' @@ -103,6 +105,7 @@ jobs: if [[ -z "${{ inputs.piwind_branch }}" ]]; then # Pull Request from PiWind (Set MDK) echo "MDK_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV + echo "SCRIPT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV else # Pull Request from OasisLMF (Set piwind) echo "PIWIND_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV diff --git a/tests/run_mdk.py b/tests/run_mdk.py index e2ec76a5..58fdf29a 100755 --- a/tests/run_mdk.py +++ b/tests/run_mdk.py @@ -257,8 +257,8 @@ def _is_non_empty_file(fp, substr_match=False, is_dir=False): assert(_is_non_empty_file(os.path.join(outputs_fp, 'il_S1_leccalc_full_uncertainty_oep.csv'))) if model_run_mode == 'ri': - assert(_is_non_empty_file(os.path.join(model_run_dir, 'ri_layers'), substr_match=True)) - assert(_is_non_empty_file(os.path.join(model_run_dir, 'RI'), substr_match=True)) + assert(_is_non_empty_file(os.path.join(bin_inputs_fp, 'ri_layers'), substr_match=True)) + assert(_is_non_empty_file(os.path.join(bin_inputs_fp, 'RI'), substr_match=True)) return True