-
Notifications
You must be signed in to change notification settings - Fork 78
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-407] Add automated tests for Analytics #398
base: dev
Are you sure you want to change the base?
Changes from 4 commits
4cf765c
bbe7752
f5baed0
756fbb4
c327942
b92a095
678ac6f
27e2dbc
021fec9
079bc20
d5018a8
f8b2a18
00f3942
aa6bc05
370d07c
38c98f6
e98e0f9
d7ad1f1
4fa0878
2e7398e
2fba851
5908426
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ public string GetUSDScenePath(string usdFileName = null) | |
usdFileName = System.Guid.NewGuid().ToString(); | ||
} | ||
|
||
if (!usdFileName.EndsWith(".usd") && !usdFileName.EndsWith(".usda") && !usdFileName.EndsWith(".usdz")) | ||
if (!usdFileName.EndsWith(".usd") && !usdFileName.EndsWith(".usda") && !usdFileName.EndsWith(".usdz") && !usdFileName.EndsWith(".usdc")) | ||
{ | ||
usdFileName += ".usda"; | ||
} | ||
|
@@ -75,6 +75,8 @@ public string GetPrefabPath(string prefabName = null, bool resource = false) | |
prefabName += ".prefab"; | ||
} | ||
|
||
var test = Path.Combine(ArtifactsDirectoryRelativePath, resource ? "Resources" : "", prefabName); | ||
michaeljblain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Debug.Log(test); | ||
return Path.Combine(ArtifactsDirectoryRelativePath, resource ? "Resources" : "", prefabName); | ||
} | ||
|
||
|
@@ -106,6 +108,15 @@ public Scene CreateTestUsdScene(string fileName = "testUsd.usda") | |
return scene; | ||
} | ||
|
||
public Scene CreateEmptyTestUsdScene(string fileName = "testUsd.usda") | ||
{ | ||
var dummyUsdPath = CreateTmpUsdFile(fileName); | ||
var scene = ImportHelpers.InitForOpen(dummyUsdPath); | ||
scene.Write("/emptyRoot", new XformSample()); | ||
scene.Save(); | ||
return scene; | ||
} | ||
|
||
[SetUp] | ||
public void InitUSDAndArtifactsDirectory() | ||
{ | ||
|
@@ -126,7 +137,14 @@ public void CleanupTestArtifacts() | |
{ | ||
if (Directory.Exists(ArtifactsDirectoryFullPath)) | ||
{ | ||
Directory.Delete(ArtifactsDirectoryFullPath, true); | ||
try | ||
{ | ||
Directory.Delete(ArtifactsDirectoryFullPath, true); | ||
} | ||
catch | ||
{ | ||
Debug.Log("Artifact Clean up has failed - This should not happen in most cases, but even if so, the test case should not be affected."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we feed back further detail on the failure by also logging the exception? |
||
} | ||
} | ||
|
||
DeleteMetaFile(ArtifactsDirectoryFullPath); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invalidFile |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 change seems to be unnecessary now since you implemented the UsdAnalyticsEvent class in the tests?
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.
Good point, will revert