Skip to content

Commit

Permalink
Merge pull request #491 from rafmudaf/dev
Browse files Browse the repository at this point in the history
Infrastructure bug fixes
  • Loading branch information
rafmudaf authored Jul 20, 2020
2 parents 5aacf65 + d587d86 commit 67daa66
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 36 deletions.
16 changes: 8 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

**Complete this sentence**
THIS PULL REQUEST __ [IS/IS NOT] __ READY TO MERGE
<!-- Is this pull request ready to be merged? -->
<!-- i.e. tests pass or are expected to fail; all development is finished; appropriate documentation is included. -->
<!-- If not but opening the pull request will facilitate development, make it a "draft" pull request -->

**Feature or improvement description**
<A clear and concise description of the new code.>
<!-- A clear and concise description of the new code. -->

**Related issue, if one exists**
<Link to a related GitHub Issue.>
<!-- Link to a related GitHub Issue. -->

**Impacted areas of the software**
<List any modules or other areas which should be impacted by this pull request. This helps to determine the verification tests.>
<!-- List any modules or other areas which should be impacted by this pull request. This helps to determine the verification tests. -->

**Additional supporting information**
<Add any other context about the problem here.>
<!-- Add any other context about the problem here. -->

**Test results, if applicable**
<Add the results from unit tests and regression tests here along with justification for any failing test cases.>
<!-- Add the results from unit tests and regression tests here along with justification for any failing test cases. -->
66 changes: 40 additions & 26 deletions .github/actions/compile-and-test/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,55 +1,69 @@
#!/bin/bash

cd /openfast
verbosecommand() { echo ">>> $1" && eval $1 && echo "<<<"; }

git fetch origin ${GITHUB_REF}:CI
git checkout CI
git submodule update
# Configure Bash to exit if any command returns an error
set -e

verbosecommand "cd /openfast"

repo="OpenFAST"
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
if [[ "${GITHUB_EVENT_NAME}" != "pull_request" ]]; then
repo=${GITHUB_ACTOR}
fi
# Create a branch "CI" at the current commit from the GH Actor's fork.
verbosecommand "git fetch https://github.com/${repo}/openfast ${GITHUB_REF}:CI"
verbosecommand "git checkout CI"
verbosecommand "git submodule update"

# Display the current git info
echo git-status from openfast:
git status
echo "*** git-status from openfast:"
verbosecommand "git status"

echo git-log from openfast:
git log -1
echo "*** git-log from openfast:"
verbosecommand "git log -1"

cd /openfast/reg_tests/r-test
echo git-status from r-test:
git status
verbosecommand "cd /openfast/reg_tests/r-test"
echo "*** git-status from r-test:"
verbosecommand "git status"

echo git-log from r-test:
git log -1
echo "*** git-log from r-test:"
verbosecommand "git log -1"

cd /openfast
verbosecommand "cd /openfast"

# Display the differences between this commit and `dev`
echo git-diff from ${GITHUB_REF} to dev:
git diff dev --numstat
echo "*** git-diff from ${GITHUB_REF} to dev:"
verbosecommand "git diff dev --numstat"

# Move into the "build" directory, remove the old reg tests, and compile
cd /openfast/build
rm -rf reg_tests
cmake ..
make -j4 install
verbosecommand "cd /openfast/build"
verbosecommand "rm -rf reg_tests"
verbosecommand "cmake .."
verbosecommand "make -j4 install"

# Run the tests

# NWTC Library tests
ctest -VV -R nwtc_library_utest
verbosecommand "ctest -VV -R nwtc_library_utest"

# BeamDyn-specific tests
ctest -VV -j7 -R bd_
ctest -VV -R beamdyn_utest
verbosecommand "ctest -VV -j7 -R bd_"
verbosecommand "ctest -VV -R beamdyn_utest"

# OLAF free vortex wake tests
ctest -VV -R fvw_utest

# OpenFAST linearization tests
# Dont run these in parallel, copying the case files can fail in a race condition
ctest -VV -L linear
# Exclude the Ideal_Beam test cases
# - They fail consistently in the Docker container when run on GitHub,
# but pass everywhere else including running the same Docker image locally
verbosecommand "ctest -VV -L linear -E Ideal"

# Subset of OpenFAST regression tests; do not run
## - 9, 16 because they're very sensitive
## - 19, 20 because theyre too long
## - 17, 22, 23 becuase we dont know why they fail :(
ctest -VV -j8 -I 1,1,1,2,3,4,5,6,7,8,10,11,12,13,14,15,18,21,24,25,26,27,28
## - 17, 22, 23 because we dont know why they fail :(
verbosecommand "ctest -VV -j8 -I 1,1,1,2,3,4,5,6,7,8,10,11,12,13,14,15,18,21,24,25,26,27,28"
4 changes: 2 additions & 2 deletions reg_tests/executeOpenfastLinearRegressionCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
l_float = float(l_element)
b_float = float(b_elements[j])
if not isclose(l_float, b_float, tolerance, tolerance):
print("Failed in Jacobian matrix comparison: {l_float} and {b_float}")
print(f"Failed in Jacobian matrix comparison: {l_float} and {b_float}")
sys.exit(1)

# skip 2 empty/header lines
Expand All @@ -259,7 +259,7 @@ def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
l_float = float(l_element)
b_float = float(b_elements[j])
if not isclose(l_float, b_float, tolerance, tolerance):
print("Failed in state matrix comparison: {l_float} and {b_float}")
print(f"Failed in state matrix comparison: {l_float} and {b_float}")
sys.exit(1)

local_handle.close()
Expand Down

0 comments on commit 67daa66

Please sign in to comment.