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

start running serialization view tests again #14590

Merged
merged 3 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions test/DynamoCoreTests/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,24 @@ public static void CompareWorkspaceModels(serializationTestUtils.WorkspaceCompar
{
var valueA = kvp.Value;
var valueB = b.NodeDataMap[kvp.Key];
var valANodeName = a.NodeTypeMap[kvp.Key].FullName;

// Ignore IntegerSlider nodes as they are being read as IntegerSlider64Bit JSON nodes.
// TODO: Remove this filter once we deprecate IntegerSlider nodes in a future Dynamo version.
if (a.NodeTypeMap[kvp.Key].FullName == "CoreNodeModels.Input.IntegerSlider")
if (valANodeName == "CoreNodeModels.Input.IntegerSlider")
{
Assert.AreEqual("CoreNodeModels.Input.IntegerSlider64Bit", b.NodeTypeMap[kvp.Key].FullName);
continue;
}
//ignore file name/object nodes - the result is dependent on where the graph was run.
//which is modified during this test.

if (valANodeName.ToLower() == "corenodemodels.input.filename" ||
valANodeName.ToLower()== "corenodemodels.input.fileobject"||
valANodeName.ToLower() == "corenodemodels.input.directory")
{
continue;
}

Assert.AreEqual(a.NodeTypeMap[kvp.Key], b.NodeTypeMap[kvp.Key]);

Expand Down Expand Up @@ -389,15 +399,26 @@ public static void CompareWorkspacesDifferentGuids(serializationTestUtils.Worksp
//convert the old guid to the new guid
var newGuid = GuidUtility.Create(GuidUtility.UrlNamespace, modelGuidsToIDmap[kvp.Key]);
var valueB = b.NodeDataMap[newGuid];
var valANodeName = a.NodeTypeMap[kvp.Key].FullName;

// Ignore IntegerSlider nodes as they are being read as IntegerSlider64Bit JSON nodes.
// TODO: Remove this filter once we deprecate IntegerSlider nodes in a future Dynamo version.
if (a.NodeTypeMap[kvp.Key].FullName == "CoreNodeModels.Input.IntegerSlider")
if (valANodeName == "CoreNodeModels.Input.IntegerSlider")
{
Assert.AreEqual("CoreNodeModels.Input.IntegerSlider64Bit", b.NodeTypeMap[newGuid].FullName);
continue;
}

//ignore file name/object nodes - the result is dependent on where the graph was run.
//which is modified during this test.

if (valANodeName.ToLower() == "corenodemodels.input.filename" ||
valANodeName.ToLower() == "corenodemodels.input.fileobject" ||
valANodeName.ToLower() == "corenodemodels.input.directory")
{
continue;
}

Assert.AreEqual(a.NodeTypeMap[kvp.Key], b.NodeTypeMap[newGuid]);

try
Expand Down
6 changes: 3 additions & 3 deletions test/DynamoCoreWpfTests/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ private void ExecutionEvents_GraphPostExecution(Dynamo.Session.IExecutionSession
/// </summary>
/// <param name="filePath">The path to a .dyn file. This parameter is supplied
/// by the test framework.</param>
[Test, TestCaseSource(nameof(FindWorkspaces)), Category("JsonTestExclude"), Category("Failure")]
[Test, TestCaseSource(nameof(FindWorkspaces)), Category("JsonTestExclude")]
public void SerializationTest(string filePath)
{
DoWorkspaceOpenAndCompareView(filePath,
Expand All @@ -981,7 +981,7 @@ public void SerializationTest(string filePath)
/// </summary>
/// <param name="filePath">The path to a .dyn file. This parameter is supplied
/// by the test framework.</param>
[Test, TestCaseSource(nameof(FindWorkspaces)), Category("JsonTestExclude"), Category("Failure")]
[Test, TestCaseSource(nameof(FindWorkspaces)), Category("JsonTestExclude")]
public void SerializationNonGuidIdsTest(string filePath)
{
modelsGuidToIdMap.Clear();
Expand Down Expand Up @@ -1067,7 +1067,7 @@ public void NewCustomNodeSaveAndLoadPt2()
File.Delete(savePath);
}

[Test, Category("Failure")]
[Test]
public void AllTypesSerialize()
{
var customNodeTestPath = Path.Combine(TestDirectory, @"core\serialization\serialization.dyn");
Expand Down