From 00a3dd60cf8bd3b1abce25be7cbabd47f3cce3f5 Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Wed, 8 May 2024 12:41:55 -0600 Subject: [PATCH] For new CI, fixed paths for copying of plots when there's a difference in output from PR changes Updating scripts to work with new Github CI --- .github/workflows/test-pr.yml | 5 ++--- tests/local/utils/attach_all_plots.bash | 15 +++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index a1a4e3b15..973a5926e 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -200,7 +200,7 @@ jobs: if: ${{ always() }} run: | mkdir -p $GITHUB_WORKSPACE/test_report - cp -r $GITHUB_WORKSPACE/candidate/build/Run/output_${{ matrix.configuration }}/* $GITHUB_WORKSPACE/test_report/ + cp -r $GITHUB_WORKSPACE/candidate/build/Run/output_diff/diff_plots/* $GITHUB_WORKSPACE/test_report/ - name: Attach diff plots to PR if: ${{ failure() }} @@ -214,5 +214,4 @@ jobs: with: name: test-reports path: | - ${{ github.workspace }}/test_report/**.html - ${{ github.workspace }}/test_report/*/diff_plots + ${{ github.workspace }}/test_report/* diff --git a/tests/local/utils/attach_all_plots.bash b/tests/local/utils/attach_all_plots.bash index 2b11d5deb..75ef57751 100644 --- a/tests/local/utils/attach_all_plots.bash +++ b/tests/local/utils/attach_all_plots.bash @@ -3,10 +3,10 @@ PR=$1 CONFIG=$2 cwd=`pwd` -diffs=$GITHUB_WORKSPACE/test_report/$CONFIG/diff_plots +diffs=$GITHUB_WORKSPACE/test_report/$CONFIG if [[ ! -d $diffs ]]; then - echo "No diff plots to attach!" + echo "No diff plots to attach at ${diffs}" exit 0 fi @@ -21,9 +21,8 @@ REPO=NCAR/wrf_hydro_nwm_public cd $diffs -for d in `ls -1` -do - if [[ -d $d && `ls -1 $d` ]]; then - python $cwd/attach_plots_to_pr.py -r $REPO -p $PR -d -t "$TOKEN" --title "$title" $d/* - fi -done \ No newline at end of file +# if $diffs directory is not empty, attach files in it +if [[ `ls -1 ./` ]] +then + python $cwd/attach_plots_to_pr.py -r $REPO -p $PR -d -t "$TOKEN" --title "$title" ./* +fi