-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Use SemVer to check communication compatibility between C# and Python #3760
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
441f4f6
[communication] Bump communication API to 1.0.0, check that major ver…
surfnerd b92abb8
add test. Update Changelog.
surfnerd 181e75f
Use version property.
surfnerd c3c668d
Update com.unity.ml-agents/Tests/Editor/Communicator/RpcCommunicatorT…
surfnerd c2ddaac
Addres PR feedback. Add tests.
surfnerd 2ae000d
black format, fix parameter for function.
surfnerd 7ba2a50
Fix type hint.
surfnerd 98210fe
Actually use the parameter instead of hard coded values.
surfnerd c6e8939
Fix hard coded version.
surfnerd 43e6f17
Add more combinations of version tests. Move check for version compa…
surfnerd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
com.unity.ml-agents/Tests/Editor/Communicator/RpcCommunicatorTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| using System; | ||
| using System.Collections; | ||
| using System.Text.RegularExpressions; | ||
| using NUnit.Framework; | ||
| using UnityEngine; | ||
| using UnityEngine.TestTools; | ||
|
|
||
| namespace MLAgents.Tests.Communicator | ||
| { | ||
| [TestFixture] | ||
| public class RpcCommunicatorTests | ||
| { | ||
|
|
||
| [Test] | ||
| public void TestCheckCommunicationVersionsAreCompatible() | ||
| { | ||
| var unityVerStr = "1.0.0"; | ||
| var pythonVerStr = "1.0.0"; | ||
surfnerd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| var pythonPackageVerStr = "0.16.0"; | ||
|
|
||
| Assert.IsTrue(RpcCommunicator.CheckCommunicationVersionsAreCompatible(unityVerStr, | ||
| pythonVerStr, | ||
| pythonPackageVerStr)); | ||
| LogAssert.NoUnexpectedReceived(); | ||
|
|
||
| pythonVerStr = "1.1.0"; | ||
| Assert.IsTrue(RpcCommunicator.CheckCommunicationVersionsAreCompatible(unityVerStr, | ||
| pythonVerStr, | ||
| pythonPackageVerStr)); | ||
|
|
||
| // Ensure that a warning was printed. | ||
| LogAssert.Expect(LogType.Warning, new Regex("(.\\s)+")); | ||
|
|
||
|
|
||
| unityVerStr = "2.0.0"; | ||
| Assert.IsFalse(RpcCommunicator.CheckCommunicationVersionsAreCompatible(unityVerStr, | ||
| pythonVerStr, | ||
| pythonPackageVerStr)); | ||
| } | ||
| } | ||
| } | ||
3 changes: 3 additions & 0 deletions
3
com.unity.ml-agents/Tests/Editor/Communicator/RpcCommunicatorTests.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.