-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add unit tests for 'basic_no_decorator.py' and 'compose.py' #111
Conversation
Merge to master
I will update test_kfp_sample.sh once #110 has merged |
@drewbutlerbb4 -- #110 has merged, please rebase |
Update compiler report card (#110)
test_kfp_samples.sh has been updated. Thanks for the suggestion to restructure the tests, @ckadner, I think this looks a lot cleaner. |
Thanks @drewbutlerbb4 -- this looks good, but would you be able to also address the second part of point number 3 mentioned in #107?
see comment :
function compile_dsl {
if [ -z "${IS_SPECIAL}" ]; then
dsl-compile-tekton --py "$1" --output "$2"
else
python3 -m test_util $1 ${CONFIG_FILE} # need to produce YAML file output
fi
}
# ...
if compile_dsl "${f}" "${TEKTON_COMPILED_YAML_DIR}/${f##*/}.yaml" >> "${COMPILER_OUTPUTS_FILE}" 2>&1 ;
then
echo "SUCCESS: ${f##*/}" | tee -a "${COMPILER_OUTPUTS_FILE}"
else
echo "FAILURE: ${f##*/}" | tee -a "${COMPILER_OUTPUTS_FILE}"
fi If not in this PR, maybe in a follow up? I need that change to restore how the |
@ckadner The least intrusive way of doing this, that I can think of, is to add an optional parameter |
On second thought we could add an optional parameter |
Actually, you could just use the "golden" YAML if the test succeeds and store it in the specified path. No need to edit the unit test case. If it fails you should exit with exit code 1 anyway (i.e. raise an Error). |
What about in the case where the pipeline compiles but doesn't match the "golden"? Wouldn't the unit test fail and we would record a FAILURE rather than a SUCCESS because it compiled? |
If the pipeline compiles but does not match the "golden" YAML, then the unit test should fail. If the change in the output YAML is desired, then the "golden" YAML needs to be regenerated (i.e. by flipping the The behavior of |
Thanks for the clarification @ckadner, amended based on your comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @drewbutlerbb4 -- this looks good. Just a few nitpicks and small code refactor request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @drewbutlerbb4 -- this looks good. I only have little nitpicks :-)
Thanks for the comments @ckadner, amended. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Thanks @drewbutlerbb4
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ckadner The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fix artifact passing for recurring runs.
Update issue templates with forms.
Resolves #107
Adds functions to help with unit tests for general nested pipelines and pipelines without decorators. Adds unit tests specifically for "basic_no_decorator.py" and "compose.py".
Also addresses some nits from #105