Skip to content

Conversation

@soswow
Copy link
Contributor

@soswow soswow commented Oct 19, 2025

Description

Adding more tests

Checklist:

  • [x I have read the contribution guidelines.
  • I have updated the documentation, if applicable. (Check if there is no
    need to update the documentation, for example if this is a bug fix that
    doesn't change the API.)
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format before submitting, I definitely will look at the CI
    test that runs clang-format and fix anything that it highlights as being
    nonconforming.

target_compile_options ( nanobind-static PRIVATE -Wno-error=zero-length-array )
target_compile_options ( rawtoaces_bindings PRIVATE -Wno-error=zero-length-array )
target_compile_options ( nanobind-static PRIVATE -Wno-error=zero-length-array -Wno-zero-length-array )
target_compile_options ( rawtoaces_bindings PRIVATE -Wno-error=zero-length-array -Wno-zero-length-array )
Copy link
Contributor Author

Choose a reason for hiding this comment

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

without this it was giving bunch of warning for stuff coming from python binding library headers

Copy link
Contributor

Choose a reason for hiding this comment

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

could you try if suppressing the warnings locally around the nanobind includes in rawtoaces_bindings would work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know what that means, tbh. Can you expand? Don't forget, not a native c++'er here

Copy link
Contributor

Choose a reason for hiding this comment

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

ignore that, it is minor. I may do that later separately

{
std::cerr << "ERROR: camera needs to be initialised prior to calling "
<< "SpectralSolver::calculate_WB()" << std::endl;
// TODO: Should here be return false?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@antond-weta is that on purpose? If not, I'll make a change. All other similar places (There are two more we return false)

Copy link
Contributor

Choose a reason for hiding this comment

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

not on purpose, please fix. thanks.


if ( !success )
{
// TODO: Potentially remove, since this code path is not reachable due to camera lookup success in the previous step.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

calling @antond-weta to decide if I understand that right

Copy link
Contributor

Choose a reason for hiding this comment

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

please replace with assert(success);

@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.81%. Comparing base (1b86a2f) to head (9ec91f3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/rawtoaces_util/image_converter.cpp 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (50.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #212      +/-   ##
==========================================
+ Coverage   72.56%   79.81%   +7.25%     
==========================================
  Files          10       11       +1     
  Lines        2114     2150      +36     
  Branches      317      325       +8     
==========================================
+ Hits         1534     1716     +182     
+ Misses        580      434     -146     
Files with missing lines Coverage Δ
src/rawtoaces_core/rawtoaces_core.cpp 87.90% <100.00%> (+1.83%) ⬆️
src/rawtoaces_util/image_converter.cpp 68.58% <0.00%> (+13.83%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b86a2f...9ec91f3. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

}

/// Tests that prepare_transform_spectral fails when no camera manufacturer information is available (should fail)
void test_missing_camera_manufacturer()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was not able to change .dng we have such that it has no make 🤷 no matter what I did with exiftools, new .dng always has "DNG" as a make. Hence I couldn't make this test go through main gate like other ones.

Copy link
Contributor

@antond-weta antond-weta left a comment

Choose a reason for hiding this comment

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

looks good

"ceres",
"nlohmann-json",
"openimageio",
{ "name": "openimageio", "features": [ "libraw" ] },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In previous windows build dependency was brought in as:

openimageio:[email protected]#1

with this change it is now

openimageio[core,libraw]:[email protected]#1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Windows tests are green now.
Previously, when I was testing on local window machine the problem was that oiio I had didn't have libraw plugin enabled when I was trying to do convertion as part of a test. So, this most likely what fixed it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My LLM convinced that this change is required. Though I am not 100% understrand what's going on here and I Am not convinced it is required. I feel like vcpkg.json change is where the problem was.

@soswow
Copy link
Contributor Author

soswow commented Nov 17, 2025

I had this realisation - all this stuff I did with running executable directly via _open (which is good from end-to-end persepective) will not count into coverage counter =\ most likely

Actually it's all good seems like

@soswow soswow requested a review from antond-weta November 20, 2025 11:47
@soswow soswow marked this pull request as ready for review November 20, 2025 11:47

// Use the DNG file with camera make but no model
std::string test_file =
"../../tests/materials/blackmagic_cinema_camera_cinemadng_no_model.dng";
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding a 5mb image file for testing just this small use case seems a bit excessive to me. I would suggest doing this: let's skip this part in the end-to-end tests. We have a configure() method which takes an ImageSpec instead of a file path. We can try using that to modify the ImageSpec for testing purposes: load a file into an ImageBuf, grab its ImageSpec, delete the camera model atribute, feed to configure(). This way we could test all sorts of bad metadata use cases.

Copy link
Contributor

@antond-weta antond-weta left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
Signed-off-by: Aleksandr Motsjonov <[email protected]>
…oduce a test utility wrapper that allow capturing of stderr buffer

Signed-off-by: Aleksandr Motsjonov <[email protected]>
@antond-weta antond-weta merged commit 07036e1 into AcademySoftwareFoundation:main Nov 22, 2025
17 of 18 checks passed
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