Skip to content

Commit

Permalink
Fix test as Ri moved to input (#185)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
sstruzik and sambles authored Aug 5, 2024
1 parent 1fb5c91 commit 23e9c32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/run_mdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ on:
type: string

env:
SCRIPT_BRANCH: 'master'
SCRIPT_BRANCH: 'main'
PIWIND_BRANCH: ${{ github.ref }}
MDK_BRANCH: 'main'
MDK_RUN: 'ri'
Expand Down Expand Up @@ -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
Expand All @@ -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'
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/run_mdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 23e9c32

Please sign in to comment.