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

Allow RunException to fail tests correctly #10909

Merged
merged 3 commits into from Feb 28, 2018

Conversation

milljm
Copy link
Member

@milljm milljm commented Feb 26, 2018

A couple RunException tests were allowed to pass when they should
have been failing. However, we still want these tests to pass, so
use expect_out, instead of expect_error for the deprecated tests
located in misc/check_error.

Closes #10907

A couple RunException tests were allowed to pass when they should
have been failing. However, we still want these tests to pass, so
use expect_out, instead of expect_error for the deprecated tests
located in misc/check_error.

Closes idaholab#10907
@@ -67,7 +67,7 @@ def processResults(self, moose_dir, options, output):
output += "#"*80 + "\n\nUnable to match the following pattern against the program's output:\n\n" + specs['expect_err'] + "\n"

if reason == '':
RunApp.testFileOutput(self, moose_dir, options, output)
reason = RunApp.testFileOutput(self, moose_dir, options, output)
Copy link
Member Author

@milljm milljm Feb 26, 2018

Choose a reason for hiding this comment

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

woops :)
If RunApp.testFileOutput set this test as failed, this test would later (the next few lines) set it as pass.

@moosebuild
Copy link
Contributor

moosebuild commented Feb 26, 2018

Job Documentation on 0ef0fdf wanted to post the following:

View the site here

This comment will be updated on new commits.

RunException tests need to exit with a non-zero.

Closes idaholab#10907
@@ -18,3 +18,4 @@
sample.update()
x = sample[0].getDistance()
y = sample[0].getSample('invalid_name') # testing this error
exit(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

@aeslaughter This test was a RunException test that requires a non-zero exit status.
It is either this change or change the test spec into a RunApp test with expect_out and setting errors to a dummy value (since there is an ERROR in the output). Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just looking for the error in the output should be fine.

Allow line_sample_error to cause an exception, but use RunApp to capture
expect_out. To do this, we need to suppress RunApp's default behavior of
labeling this exception causing test as a failure, by overriding the
errors parameter with a string which will never occur in the output.

Closes idaholab#10907
@brianmoose
Copy link
Contributor

The failing Mac Tests are not related to this PR

@brianmoose brianmoose merged commit c5ccaa9 into idaholab:devel Feb 28, 2018
@milljm milljm deleted the RunException-10907 branch March 20, 2020 22:31
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.

None yet

4 participants