Skip to content

Commit

Permalink
merged develop and resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe committed Jul 18, 2022
2 parents f52cb99 + 2da1f91 commit 9dd8dfe
Show file tree
Hide file tree
Showing 140 changed files with 3,967 additions and 4,008 deletions.
18 changes: 12 additions & 6 deletions .github/actions/run_tests/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ WS_PATH=$RUNNER_WORKSPACE/$REPO_NAME
# set CI jobs directory variable to easily move it
CI_JOBS_DIR=.github/jobs

PYTESTS_GROUPS_FILEPATH=.github/parm/pytest_groups.txt

source ${GITHUB_WORKSPACE}/${CI_JOBS_DIR}/bash_functions.sh

# get branch name for push or pull request events
Expand All @@ -30,10 +32,8 @@ if [ $? != 0 ]; then
${GITHUB_WORKSPACE}/${CI_JOBS_DIR}/docker_setup.sh
fi

#
# running unit tests (pytests)
#
if [ "$INPUT_CATEGORIES" == "pytests" ]; then
if [[ "$INPUT_CATEGORIES" == pytests* ]]; then
export METPLUS_ENV_TAG="pytest"
export METPLUS_IMG_TAG=${branch_name}
echo METPLUS_ENV_TAG=${METPLUS_ENV_TAG}
Expand All @@ -56,14 +56,20 @@ if [ "$INPUT_CATEGORIES" == "pytests" ]; then
.

echo Running Pytests
command="export METPLUS_PYTEST_HOST=docker; cd internal_tests/pytests; /usr/local/envs/pytest/bin/pytest -vv --cov=../../metplus"
command="export METPLUS_PYTEST_HOST=docker; cd internal_tests/pytests;"
command+="status=0;"
for x in `cat $PYTESTS_GROUPS_FILEPATH`; do
marker="${x//_or_/ or }"
marker="${marker//not_/not }"
command+="/usr/local/envs/pytest/bin/pytest -vv --cov=../../metplus -m \"$marker\""
command+=";if [ \$? != 0 ]; then status=1; fi;"
done
command+="if [ \$status != 0 ]; then echo ERROR: Some pytests failed. Search for FAILED to review; false; fi"
time_command docker run -v $WS_PATH:$GITHUB_WORKSPACE --workdir $GITHUB_WORKSPACE $RUN_TAG bash -c "$command"
exit $?
fi

#
# running use case tests
#

# split apart use case category and subset list from input
CATEGORIES=`echo $INPUT_CATEGORIES | awk -F: '{print $1}'`
Expand Down
5 changes: 3 additions & 2 deletions .github/jobs/free_disk_space.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
echo Checking disk usage before cleanup
df -h

echo Removing files as suggested by https://github.com/actions/virtual-environments/issues/2840
printf "\nRemoving files as suggested by https://github.com/actions/virtual-environments/issues/2840"

sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

echo Checking disk usage after cleanup
printf "\nChecking disk usage after cleanup"

df -h
2 changes: 1 addition & 1 deletion .github/jobs/get_metviewer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ docker ps -a
# TODO: when METviewer Dockerfile changes METdatadb to METdataio, update path to sql file accordingly
# commands to run inside METviewer container
cmd="mysql -hmysql_mv -uroot -pmvuser -e\"create database mv_metplus_test;\";"
cmd+="mysql -hmysql_mv -uroot -pmvuser mv_metplus_test < /METviewer-python/METdatadb/METdbLoad/sql/mv_mysql.sql"
cmd+="mysql -hmysql_mv -uroot -pmvuser mv_metplus_test < /METviewer-python/METdataio/METdbLoad/sql/mv_mysql.sql"
cmd+=";mysql -hmysql_mv -uroot -pmvuser -e\"show databases;\""

# execute commands inside metviewer container to create database
Expand Down
7 changes: 5 additions & 2 deletions .github/jobs/get_use_cases_to_run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#! /bin/bash

use_case_groups_filepath=.github/parm/use_case_groups.json

# set matrix to string of an empty array in case no use cases will be run
matrix="[]"

Expand Down Expand Up @@ -31,12 +32,14 @@ fi
if [ "$run_unit_tests" == "true" ]; then
echo Adding unit tests to list to run

pytests="\"pytests\","

# if matrix is empty, set to an array that only includes pytests
if [ "$matrix" == "[]" ]; then
matrix="[\"pytests\"]"
matrix="[${pytests:0: -1}]"
# otherwise prepend item to list
else
matrix="[\"pytests\", ${matrix:1}"
matrix="[${pytests}${matrix:1}"
fi
fi

Expand Down
6 changes: 6 additions & 0 deletions .github/parm/pytest_groups.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
util
wrapper
wrapper_a
wrapper_b
wrapper_c
plotting_or_long
8 changes: 4 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,24 +142,24 @@ jobs:
# copy logs with errors to error_logs directory to save as artifact
- name: Save error logs
id: save-errors
if: ${{ always() && steps.run_tests.conclusion == 'failure' && matrix.categories != 'pytests' }}
if: ${{ always() && steps.run_tests.conclusion == 'failure' && !startsWith(matrix.categories,'pytests') }}
run: .github/jobs/save_error_logs.sh

# run difference testing
- name: Run difference tests
id: run-diff
if: ${{ needs.job_control.outputs.run_diff == 'true' && steps.run_tests.conclusion == 'success' && matrix.categories != 'pytests' }}
if: ${{ needs.job_control.outputs.run_diff == 'true' && steps.run_tests.conclusion == 'success' && !startsWith(matrix.categories,'pytests') }}
run: .github/jobs/run_difference_tests.sh ${{ matrix.categories }} ${{ steps.get-artifact-name.outputs.artifact_name }}

# copy output data to save as artifact
- name: Save output data
id: save-output
if: ${{ always() && steps.run_tests.conclusion != 'skipped' && matrix.categories != 'pytests' }}
if: ${{ always() && steps.run_tests.conclusion != 'skipped' && !startsWith(matrix.categories,'pytests') }}
run: .github/jobs/copy_output_to_artifact.sh ${{ steps.get-artifact-name.outputs.artifact_name }}

- name: Upload output data artifact
uses: actions/upload-artifact@v2
if: ${{ always() && steps.run_tests.conclusion != 'skipped' && matrix.categories != 'pytests' }}
if: ${{ always() && steps.run_tests.conclusion != 'skipped' && !startsWith(matrix.categories,'pytests') }}
with:
name: ${{ steps.get-artifact-name.outputs.artifact_name }}
path: artifact/${{ steps.get-artifact-name.outputs.artifact_name }}
Expand Down
Loading

0 comments on commit 9dd8dfe

Please sign in to comment.