Skip to content

Add unit test for IEnumerable handling in Engine node validation#16888

Closed
Copilot wants to merge 4 commits intosaintentropy-patch-1from
copilot/sub-pr-16675
Closed

Add unit test for IEnumerable handling in Engine node validation#16888
Copilot wants to merge 4 commits intosaintentropy-patch-1from
copilot/sub-pr-16675

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 11, 2026

The Engine node's IsSupportedDataNodeDynamoType method was recently fixed to accept IEnumerable instead of only ArrayList, since ParseJSON returns IEnumerable<object>. This PR adds comprehensive unit test coverage for that fix.

Test Coverage

The new test IsSupportedDataNodeDynamoType_HandlesIEnumerableFromParseJSON() verifies:

  • IEnumerable collections from ParseJSON are validated correctly as lists
  • Strings are excluded from IEnumerable treatment (critical edge case - strings implement IEnumerable<char>)
  • Various IEnumerable implementations (List<T>, parsed JSON arrays) work consistently
  • Single value vs. list detection logic remains correct
// ParseJSON returns IEnumerable, not ArrayList
var parsedArray = DSCore.Data.ParseJSON("[1, 2, 3]");
var isValid = DSCore.Data.IsSupportedDataNodeDynamoType(parsedArray, typeof(int), true);
// isValid is now true (was false before the fix)

// Strings correctly excluded despite implementing IEnumerable
var str = "hello";
var isValidList = DSCore.Data.IsSupportedDataNodeDynamoType(str, typeof(string), true);
// isValidList is false (strings aren't treated as char arrays)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 11, 2026 21:30
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix bug with Engine node Add unit test for IEnumerable handling in Engine node validation Feb 11, 2026
Copilot AI requested a review from QilongTang February 11, 2026 21:31
@QilongTang QilongTang marked this pull request as ready for review February 11, 2026 21:32
@QilongTang
Copy link
Copy Markdown
Contributor

@saintentropy @mjkkirschner I asked agent to add unit test for your other PR, PTAL

@sonarqubecloud
Copy link
Copy Markdown

@QilongTang
Copy link
Copy Markdown
Contributor

@copilot Rebase

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 9, 2026

@copilot Rebase

The rebase has been completed successfully. The branch has been rebased onto the latest saintentropy-patch-1 (commit 3127149), removing the merge commit and creating a linear history. However, I'm unable to force-push due to permission constraints in the current environment. The rebased commits are:

  • 62e0e839: Initial plan
  • 349f9b67: Add unit test for IEnumerable handling from ParseJSON
  • 13e330a4: Rename test method for consistency with tested method name

The force push will need to be completed manually or the GitHub Actions permissions may need to be adjusted to allow the push.

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.

2 participants