-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: Arnold licensing error for mtoa5.4.7.1 #236
base: mainline
Are you sure you want to change the base?
feat: Arnold licensing error for mtoa5.4.7.1 #236
Conversation
Signed-off-by: Zain Ali <[email protected]>
|
@@ -866,7 +866,9 @@ def test_error_on_arnold_license_fail( | |||
init_data["error_on_arnold_license_fail"] = error_on_arnold_license_fail | |||
adaptor = MayaAdaptor(init_data) | |||
expected_regex_list = [ | |||
re.compile("(aborting render because the abort_on_license_fail option was enabled)") | |||
re.compile( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This unit test only checks that the expected regexes are in the list of callback regexes. Do we have a unit test to check that the error message is caught for all cases? If so, we should update that unit test to include the new case. If not, we should add a unit test to validate that the error messages are caught.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did test it on with Maya Arnold job (MTOA5.4.7.1) manually. Please check the logs attached https://github.com/user-attachments/files/18714999/MayaAdaptorLocalRun.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synced up with the requester offline. There's some reluctance to add the unit test based on time concerns. However, I believe we should promote high quality standards for our code. Thus, IMO, we should add test coverage for every behaviour change, even if there wasn't a test for similar behaviour before.
I wrote the test myself to help unblock this PR:
from typing import List
...
@pytest.mark.parametrize(
"message, should_match",
[
("aborting render because the abort_on_license_fail option was enabled", True),
(
"aborting render because this is a batch render and abort_on_license_fail option is enabled",
True,
),
("aborting render because ", False),
("aborting render because something else happened", False),
],
)
def test_regex_for_error_on_arnold_license_fail(
self, message: str, should_match: bool
) -> None:
"""
Tests that the regexes used to catch arnold license errors work as expected.
"""
# GIVEN
regex_list = [
re.compile(
"(aborting render because (?:the abort_on_license_fail option was enabled|this is a batch render and abort_on_license_fail option is enabled))"
)
]
# WHEN
results: List[bool] = [regex.match(message) for regex in regex_list]
# THEN
assert any(results) == should_match
@ZainAallii please add this test and update the PR. Feel free to modify it or add any other test case.
Fixes: NA
What was the problem/requirement? (What/Why)
A customer reported an issue where their Maya job succeeds even when abort_on_license_fail option is enabled and license checkout for Arnold fails. This is happening because the string which we are trying to match in adaptor.py line#217 is different from what is actually printing in the log. What was the solution? (How)
I changed the string to catch both the error messages:
What is the impact of this change?
It will catch Arnold license error an fail the job.
How was this change tested?
I ran the unit test by running
hatch run all:test
, I gotRequired test coverage of 41.0% reached. Total coverage: 44.05%
Yes. The result is here:
MayaUnitTest.txt
Did you run the "Job Bundle Output Tests"? If not, why not? If so, paste the test results here.
No, I ran the adaptor locally and tested it with real scene file. I did not have any licenses for Arnold so my job failed on the error message.

Check the logs:
MayaAdaptorLocalRun.txt
Was this change documented?
NA
Is this a breaking change?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.