Page MenuHome

Added Operator tests: unsubdivide, shading, vertex connect and mark seam
ClosedPublic

Authored by Himanshi Kalra (calra) on Apr 5 2021, 2:13 PM.

Details

Summary

Added tests for:

  • Mark Seam
  • Shade flat
  • Shade smooth
  • Unsubdivide
  • Vertex Connect Path
  • select nth (Checkered Deselect)

Notes:

  1. Shade flat, shade smooth are base test cases (to check mesh doesn't change for real)

Added test cases for ref:


Here is the attached blend file:

Diff Detail

Repository
rB Blender
Branch
add_operator_tests (branched from master)
Build Status
Buildable 13882
Build 13882: arc lint + arc unit

Event Timeline

Himanshi Kalra (calra) requested review of this revision.Apr 5 2021, 2:13 PM
Himanshi Kalra (calra) created this revision.
Himanshi Kalra (calra) edited the summary of this revision. (Show Details)Apr 5 2021, 2:19 PM
  • More tests for Select nth and vertex Connect Path
Himanshi Kalra (calra) edited the summary of this revision. (Show Details)Apr 5 2021, 9:52 PM
Himanshi Kalra (calra) edited the summary of this revision. (Show Details)
Habib Gahbiche (zazizizou) requested changes to this revision.Apr 11 2021, 4:51 PM

Test cases are good. Just some comments about comments and style:

  • Keep style in blend file consistent: collections are named after operators, not test cases. Look at other collection names for more examples.
  • If you think a test is failing because of a bug, please add task number to todo comment. Ideally, also add comment in bug report to activate the test once fixed, if that hasn't been done already.
tests/python/operators.py
241–245

This is not really a mesh operator that changes the mesh it operates on, so it won't be part of this framework. So I think it's better to remove this from here.

335

is there a bug report for this?

This revision now requires changes to proceed.Apr 11 2021, 4:51 PM
  • Add test cases for T87259, addressed comments by Habib
  • Merge branch 'master' into add_operator_tests
  • Minor fixes
Himanshi Kalra (calra) edited the summary of this revision. (Show Details)Apr 13 2021, 8:22 PM
Himanshi Kalra (calra) marked an inline comment as done.Apr 13 2021, 8:27 PM

Keep style in blend file consistent: collections are named after operators, not test cases. Look at other collection names for more examples.

Noted, thanks! I did it unconsciously, have updated the blend file.

If you think a test is failing because of a bug, please add task number to todo comment. Ideally, also add comment in bug report to activate the test once fixed, if that hasn't been done already.

Yes, that was done, added the bug number in the comments in the code as well.

tests/python/operators.py
335

No, as discussed on blender chat. I have added the normal case for vertex connect path.

Habib Gahbiche (zazizizou) requested changes to this revision.Apr 19 2021, 8:07 PM

Look at other collection names for more examples.

I should have been more explicit here. You should keep collections (as well as the position of the objects) ordered alphabetically just like the others. We do this to make adding tests and refactoring easier.

Also, remember to keep T84999 up to date, there seems to be an outdated todo there? And since we agreed add primitive operators won't be covered you could remove them from the list as well.

The rest looks fine to me.

This revision now requires changes to proceed.Apr 19 2021, 8:07 PM

We do this to make adding tests and refactoring easier.

Could you explain more on this? How does that help?

I understand the alphabetical ordering in the Collections, but by objects do you mean, to move the existing objects and make space for new objects in between to keep them sorted?
Given a long list objects, wouldn't it be easier to know new test objects are added towards the end?

Edit: The operator blend file has not been updated yet, waiting for clarification.

Himanshi Kalra (calra) retitled this revision from Added Operator tests: unsubdivide, mesh primitives, mark seam to Added Operator tests: unsubdivide, shading, vertex connect and mark seam.Apr 19 2021, 8:32 PM
Himanshi Kalra (calra) edited the summary of this revision. (Show Details)

We do this to make adding tests and refactoring easier.

Could you explain more on this? How does that help?

I understand the alphabetical ordering in the Collections, but by objects do you mean, to move the existing objects and make space for new objects in between to keep them sorted?

It's mostly a matter of style to keep the file organized. Same reason we have style for code.

Given a long list objects, wouldn't it be easier to know new test objects are added towards the end?

I prefer an organized file with sorted objects over a big mess.

Himanshi Kalra (calra) edited the summary of this revision. (Show Details)Apr 22 2021, 2:38 PM

Updated the blend file with alphabetical ordering in 3D space as well as the Outliner.

Given a long list objects, wouldn't it be easier to know new test objects are added towards the end?

I prefer an organized file with sorted objects over a big mess.

This was discussed again on blender chat for more clarity, this meant having 2 separate designs

  1. Sort by alphabetical
  2. Sort by last modified

could lead to a "mess" which could potentially confuse new contributors which one to follow.
So, the conclusion is the 1. design i.e. Sort by Alphabetical will be followed for this file.

This revision now requires review to proceed.Apr 22 2021, 6:15 PM

LGTM from quick look. :)

This revision is now accepted and ready to land.Apr 26 2021, 4:04 PM
Himanshi Kalra (calra) edited the summary of this revision. (Show Details)Apr 29 2021, 3:21 PM
  • Merge branch 'master' into add_operator_tests