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

Create more tests of NeXus::File using based on old napi tests #39027

Merged
merged 16 commits into from
Mar 13, 2025

Conversation

rboston628
Copy link
Contributor

@rboston628 rboston628 commented Mar 6, 2025

Description of work

Summary of work

This adds more tests or NeXus::File, which will be very important before we begin any work on removing napi. These tests are based on tests of napi, so should ensure continuity of behavior.

Related to #38332

Follow-on to PR #39010, adding tests taken from napi_test.cpp, originally written for napi.

Further detail of work

Writing this I had to compare to the napi_test.cpp file, and I got sick of the incessant

if(NXsomething(fileid, etc) != NXstatus::NX_OK) {
  std::cout << "some error message!\n;
  return TEST_FAILED;
}

cluttering it. So I introduced a macro to make these all one line. It should not change any behavior.

To test:

This is adding tests, and not messing with any functionality. Make sure the new tests pass.


Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@sf1919
Copy link
Contributor

sf1919 commented Mar 7, 2025

This one looks like a genuine test failure so I will leave it alone.

@rboston628 rboston628 added this to the Release 6.13 milestone Mar 7, 2025
@rboston628 rboston628 added ORNL Team Issues and pull requests managed by the ORNL development team Technical Debt Marks a piece of work to address technical debt introduced to solve a problem quickly labels Mar 7, 2025
@rboston628 rboston628 marked this pull request as ready for review March 10, 2025 19:12

// cleanup and return
fileid.close();
cout << "all ok - done\n";
Copy link
Member

Choose a reason for hiding this comment

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

I don't know that the "all ok" messages are still needed since this is asserting things are equal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was really helpful for debugging, especially with segfaults/stack overflows, to know that a test had definitively ended. But I can make them more descript.

Copy link
Member

@peterfpeterson peterfpeterson left a comment

Choose a reason for hiding this comment

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

Copying the tests over to NexusFile is a good step. I look forward to the c-api tests going away soon.

@KedoKudo KedoKudo merged commit 32a94a6 into main Mar 13, 2025
10 checks passed
@KedoKudo KedoKudo deleted the ewm9904-new-napi-test branch March 13, 2025 20:34
rboston628 added a commit that referenced this pull request Mar 14, 2025
…39027)

* save progress

* more output to see source of error

* change leak test 3 on windows

* error macro in napi_test for better readability

* link test working

* slab tests

* try fixing the windows test failure

* fix windows test issue for real

* fix test that windows is incapable of running

* last time

* maybe the problem is file names?

* address comments remove test data dependency

* maybe it was napi_test.cpp all along

* try using correct macro

* try again

* the problem was literally the first thing I tried
rboston628 added a commit that referenced this pull request Mar 14, 2025
…`ornl-next` (#39060)

Create more tests of `NeXus::File` using based on old `napi` tests (#39027)

* save progress

* more output to see source of error

* change leak test 3 on windows

* error macro in napi_test for better readability

* link test working

* slab tests

* try fixing the windows test failure

* fix windows test issue for real

* fix test that windows is incapable of running

* last time

* maybe the problem is file names?

* address comments remove test data dependency

* maybe it was napi_test.cpp all along

* try using correct macro

* try again

* the problem was literally the first thing I tried
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ORNL Team Issues and pull requests managed by the ORNL development team Technical Debt Marks a piece of work to address technical debt introduced to solve a problem quickly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants