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

HPCC-33499 Update esdltests failure identification and reporting #19576

Open
wants to merge 3 commits into
base: candidate-9.10.x
Choose a base branch
from

Conversation

asselitx
Copy link
Contributor

@asselitx asselitx commented Feb 28, 2025

  • Use CPPUNIT macros for testing success and printing messages on failure.
  • Print timing and other non-failure test information using DBGLOG to leverage the -v verbose option. Re-direct script context tracing away from stdout for the same reason.

Some test cases generate expected errors. Since the underlying libxml2 prints parsing and XPath errors and warnings to stderr, you will see messages that look like failures even when all tests succeed. A separate ticket is opened to suppress these errors and warnings: HPCC-33544.

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

- Use CPPUNIT macros for testing success and printing messages on failure.
- Print timing and other non-failure test information using DBGLOG to leverage
  the -v verbose option. Re-direct script context tracing away from stdout for
  the same reason.

Some test cases generate expected errors. Since the underlying libxml2 prints
parsing and XPath errors and warnings to stderr, you will see messages that
look like failures even when all tests succeed. A separate ticket is opened
to suppress these errors and warnings: HPCC-33544.

Signed-off-by: Terrence Asselin <terrence.asselin+copilot@lexisnexisrisk.com>
Copy link

Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-33499

Jirabot Action Result:
Workflow Transition To: Merge Pending
Updated PR

- Add assert to catch tests that should throw an exception but don't.
- Update the implicit prefix test to remove an incorrect assumption that
  using the implicitly-defined "n" prefix is required when a default
  namespace is used.

Signed-off-by: Terrence Asselin <terrence.asselin+copilot@lexisnexisrisk.com>
Copy link
Contributor

@timothyklemm timothyklemm left a comment

Choose a reason for hiding this comment

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

Check with @AttilaVamos to see if the added use of DBGLOG in passing tests is acceptable, or if test output should be limited to failure messages.

}
fprintf(stdout, "\nTxSummary-%s-%s) '%s' close enough to '%s'\n", prefix, test, actualText.str(), expectedText);
DBGLOG("\nTxSummary-%s-%s) '%s' close enough to '%s'\n", prefix, test, actualText.str(), expectedText);
Copy link
Contributor

Choose a reason for hiding this comment

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

As the author of this test, I'm not sure this line adds value. It can probably be removed. If retained, consider removing unnecessary EOLN characters. DBGLOG should already give us that. Double check this for all output messages.

Copy link
Contributor Author

@asselitx asselitx Mar 5, 2025

Choose a reason for hiding this comment

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

Ok removed that one. Confirming with Attila about the couple others.

VStringBuffer msg(" %2u: %d/%d/%s\n", ++idx, he.msgAudience, he.msgClass, he.msg.str());
accumulatedMessage.append(msg);
}
CPPUNIT_ASSERT_EQUAL_MESSAGE(accumulatedMessage.str(), expected.size(), sink->history.size());
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe CPPUNIT_FAIL? The check on 2222 guarantees the test failure. A casual reader might not realize this is guaranteed to fail and expect the test to continue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to FAIL

printf("\nOOOPs Exception %d - %s\n", E->errorCode(), E->errorMessage(msg).str());
throw E;
StringBuffer m;
VStringBuffer exceptionMessage("Unexpected Exception: code=%d, message=%s", E->errorCode(), E->errorMessage(m).str());
Copy link
Contributor

Choose a reason for hiding this comment

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

Trivial, but with the exception of the exception caught in runTest all exceptions are unexpected. Even there, the only messaging will be for unexpected exceptions. Not sure that Unexpected is necessary every time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Remove some unnecessary output and clean up messages.

Signed-off-by: Terrence Asselin <terrence.asselin+copilot@lexisnexisrisk.com>
@asselitx
Copy link
Contributor Author

asselitx commented Mar 7, 2025

Confirmed with Attila that the OBT and smoketest don't use the -v option, so DBGLOG output won't jam the works.

@asselitx asselitx requested a review from timothyklemm March 7, 2025 15:12
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.

2 participants