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

[USDU-249] Adds test case for InitUSD #330

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Conversation

lee-aandrew
Copy link
Contributor

Purpose of this PR

USDU-249

Testing

Adds test cases for InitUsd script
tries to check if an early throw / exit is done when given wrong parameter value for function InitUsd.SetupUsdPath()

Complexity:
1

Halo Effect:
1

@lee-aandrew lee-aandrew changed the title Add test init usd [USDU-249] Adds test case for InitUSD Jan 4, 2023
Copy link
Collaborator

@vickycl vickycl left a comment

Choose a reason for hiding this comment

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

I think we need to rethink how to thoroughly test the InitUSD.Initialize test without it impacting/ being impacted by the other tests having the plugin initialised. Perhaps we could make a fake instance (not sure how it would interact with the real instance though) or maybe we need a test outside of UTR...

}

[Test]
public void InitUsd_Initialize()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add the expected result to the end of the test name, something like "InitUsd_Initialize_Succeeds"

// Reset 'm_usdInitialized' for accurate testing
ResetInitUsd();

Assert.True(InitUsd.Initialize(), "USD Initialize failed");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a more robust thing we can also check for, as well as the return value of Initialise()?

Copy link
Collaborator

Choose a reason for hiding this comment

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

eg check that the plugin is registered, that the expected debug log is printed, that no other errors are handled and logged.

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've looked into this a bit more - on how to tell if the plugin has been registered and the typebinding
But I just ended up having more questions, do you know who I should be asking about the init steps?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can check that unity types have been added the TypeBinder, that usd error message are logged in Unity console and that the plugins Registry is not empty. We can chat if you have more questions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @judubu - I will contact you via slack!

Copy link
Contributor Author

@lee-aandrew lee-aandrew Jan 27, 2023

Choose a reason for hiding this comment

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

After talking with Julien, it turns out the PlugRegistry is not behaving correctly - created a separate JIRA ticket for this
https://jira.unity3d.com/browse/USDU-295

Will continue work on this PR after the above JIRA ticket has been solved

public void InitUsd_Initialize()
{
// Reset 'm_usdInitialized' for accurate testing
ResetInitUsd();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure that just changing the bool is enough here. Initialize() does stuff that might affect this test, such as setting up the UnityTypeBindings for USD. I'm not sure what the answer is though :D

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.

4 participants