Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded built-in suites to cylc7. #2233

Merged
merged 2 commits into from
Apr 8, 2017

Conversation

oliver-sanders
Copy link
Member

Our built-in examples were getting out of date, this adds a validation check to the test battery.

@oliver-sanders oliver-sanders added this to the next release milestone Apr 6, 2017
@oliver-sanders oliver-sanders self-assigned this Apr 6, 2017
#out_file.write(re.sub(r'.*naked dummy tasks detected.*\n(\+\t.*\n)+',
# '', in_file.read()))
out_file.write(contents)" "$1"
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had to filter out some messages for certain suites to pass. Are the "offsets are normally positive" messages necessary?

Copy link
Contributor

@matthewrmshin matthewrmshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK. Please consider addressing the style comments on bash.

#-------------------------------------------------------------------------------
# Validate suites.
for suite in ${SUITES[@]}; do
suite_name=$(echo ${suite:$ABS_PATH_LENGTH} | sed 's/\//-/g')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single command with no pipe:

suite_name=$(sed 's/\//-/g' <<<"${suite:$ABS_PATH_LENGTH}")

SUITES=
for path in ${PATHS[@]}; do
SUITES+=($(find "${CYLC_DIR}/${path}" -name 'suite.rc'))
done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be a single command?

SUITES="$(find "${CYLC_DIR}/"{examples,dev/suites} -name 'suite.rc')"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know you could do that, nice!

suite_name=$(echo ${suite:$ABS_PATH_LENGTH} | sed 's/\//-/g')
TEST_NAME="${TEST_NAME_BASE}${suite_name}"
run_ok "${TEST_NAME}" cylc validate "${suite}" -v -v
filter_warnings "${TEST_NAME}.stderr"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this just be a sed -i? E.g.:

sed -i '
/naked dummy tasks detected/d;
/clock-\(trigger\|expire\) offsets are normally positive/d;
' "${TEST_NAME}.stderr"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naked dummy tasks detected messages are followed by + <task name> lines which have to be filtered out as well. I couldn't workout how to perform a suitable multi-line sed deletion so went with python.

@hjoliver
Copy link
Member

hjoliver commented Apr 7, 2017

@oliver-sanders - do we still need tests/validate/04-check-examples.t now?

@oliver-sanders
Copy link
Member Author

do we still need tests/validate/04-check-examples.t now?

Nope.

@hjoliver hjoliver merged commit e4e1509 into cylc:master Apr 8, 2017
@oliver-sanders oliver-sanders deleted the validate-suites branch December 14, 2017 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants