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

Return FAIL if tests are not found #1130

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

pkatlic
Copy link
Contributor

@pkatlic pkatlic commented Dec 11, 2023

Include specified test names in test list even if not found in test file in order to print names of tests not found. Return FAIL if no tests pass or any tests fail or are not found.

DAFFODIL-2699

Main.scala: Include all test names for listing even if not found, update return code logic to check for no passing tests and any tests failing or not found.

TestCLItdml.scala: Update expected exit codes based on new return code logic, note that test_CLI_Tdml_Listing_negativeTest01 now returns FAIL due to tests not found and test_CLI_catch_TestNotCompatible now returns FAIL due to no passing tests.

Copy link
Contributor

@tuxji tuxji left a comment

Choose a reason for hiding this comment

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

+1 assuming CI passes

Copy link
Member

@stevedlawrence stevedlawrence left a comment

Choose a reason for hiding this comment

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

+1, one question about the pass > 0 condition

@@ -1729,7 +1732,7 @@ class Main(
),
)

if (fail == 0) ExitCode.Success else ExitCode.TestError
if (pass > 0 && fail == 0 && notfound == 0) ExitCode.Success else ExitCode.TestError
Copy link
Member

Choose a reason for hiding this comment

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

Should we remove the pass > 0 condition? I'm thinking of an an edge case where a tdml file has no tests defined and a user runs daffodil test no_tests.tdml. If we require pass > 0 to be considered a success, then that command would exit with failure even though nothing technically failed. Maybe there's an argument that running no tests should be a failure? But using SBT as an example, running a test suite with no tests is considered a success. Maybe there are other counter examples?

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, agreed that pass > 0 can be removed.

Include specified test names in test list even if not found in
test file in order to print names of tests not found. Return
FAIL if any tests fail or are not found.

DAFFODIL-2699

Main.scala: Include all test names for listing even if not
found, update return code logic to check for any tests
failing or not found.

TestCLItdml.scala: Update expected exit codes based on new
return code logic, note that test_CLI_Tdml_Listing_negativeTest01
now returns FAIL due to tests not found.
@pkatlic pkatlic force-pushed the daffodil-2699-test-not-found branch from db9257c to 35b3b4c Compare December 11, 2023 21:29
@tuxji tuxji merged commit c58434c into apache:main Dec 11, 2023
10 checks passed
@pkatlic pkatlic deleted the daffodil-2699-test-not-found branch January 9, 2024 16:15
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