Enhance the unit.py
MET testing script to allow for expected failures
#2937
Labels
component: testing
Software testing issue
priority: high
High Priority
requestor: METplus Team
METplus Development Team
required: FOR OFFICIAL RELEASE
Required to be completed in the official release for the assigned milestone
type: new feature
Make it do something new
Milestone
Describe the New Feature
This issue is derived from dtcenter/METplus-Internal#23.
This task is to enhance the logic of the
unit.py
MET testing script to allow for expected failures.That script reads one or more input XML files specified as command line arguments. Each XML file consists of one or more tests, each defined using the
<test>
XML tag. For each test, the<exec>
tag specifies the command that should be executed, which is typically a call to a MET executable. If the command run for that test returns non-zero status, then the test fails, prints a failure message, and writes the test output to the screen. For example:This issue is to enhance the control logic to allow for expected failures. So that even though the command may return non-zero status, the test can still pass - if that's what was expected.
Recommend adding a new tag to the MET test XML named
<retval>
. Use it to specify the expected return value from the<exec>
command. Note that<retval>
should be optional. If not present, the logic should use a default value of 0, which indicates a successful run.Update the Python control logic to capture the return value from the
<exec>
command and compare it against the expected return value (either explicitly specified with<retval>
or using the default value of 0 otherwise). If they match, the test succeeds. If they do not match, the test fails, and the stdout should be printed, which is the current behavior.Acceptance Testing
Please add at least one unit test that uses
<retval>
to specify an expected non-zero return value to demonstrate this new functionality.Time Estimate
2 days?
Sub-Issues
Consider breaking the new feature down into sub-issues.
Relevant Deadlines
List relevant project deadlines here or state NONE.
Funding Source
Define the source of funding and account keys here or state NONE.
Define the Metadata
Assignee
Labels
Milestone and Projects
Define Related Issue(s)
Consider the impact to the other METplus components.
No impacts.
New Feature Checklist
See the METplus Workflow for details.
Branch name:
feature_<Issue Number>_<Description>
Pull request:
feature <Issue Number> <Description>
Select: Reviewer(s) and Development issue
Select: Milestone as the next official version
Select: MET-X.Y.Z Development project for development toward the next official release
The text was updated successfully, but these errors were encountered: