-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add basic PlantUML support for feature request #78 (2nd attempt) #86
Conversation
merge from base
- first test running Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
Signed-off-by: Marco Studer <[email protected]>
The CompilerGeneratedTypesTests is failing on the server, locally it succeeds. I don't see any connection with my changes. |
Nice, that looks good :) As for the tests, you are right. Locally I also have a green test. However, something interesting happened when I ran the tests in Debug/Non-Release mode (unfortunately there are subtle differences in what ArchUnit can see depending on Release/Debug compilation). In the Non-Release build suddenly the ClassResidesInMultipleNamespaces test fails.
Can you reproduce this? As for the CompilerGeneratedTypesTests: @brandhuf , I could not reproduce whats happening on Travis. Do you have an idea? Also: Why does the Travis build not catch the ClassResidesInMultipleNamespaces I see locally? |
Signed-off-by: Marco Studer <[email protected]>
When I migrated the ClassResidesInMultipleNamespaces test to use a MemoryStream I noticed an ordering problem when creating the puml diagram in the arrange phase of the test. I fixed the test by changing the assert. Now that @fgather reports that the order is different on his machine I changed back to use a FileStream instead of a MemoryStream. |
I ran the ClassResidesInMultipleNamespaces test multiple times and sometimes it fails and sometimes it passes. That's probably why it passed in Travis, while failing on @fgather 's machine. As for the CompilerGeneratedTypesTests: The error seems to be related to https://docs.microsoft.com/en-us/dotnet/api/system.io.enumeration.filesystementry?view=net-5.0 so maybe it only fails on Linux while passing on Windows? I will try to replicate it. |
CompilerGeneratedTypesTests fails on my linux machine aswell, I will look into it |
The error in CompilerGeneratedTypesTests occurs, because FileSystemEntry contains an unsafe fixed char array, which gets compiled into a field with compiler generated field type. The test did not fail in earlier builds, because no type with an unsafe fixed array was referenced in the test assembly. #87 should fix the problem. |
Thanks, @brandhuf for quickly fixing this. Of course now that I want to re-test everything, the Travis VM cannot find its dependencies anymore, because Microsoft seems to have decided to rearrange package structures. |
the travis env was fixed :) I'll merge and release this. Afterwards we can clean up the equals/gethashcode functions, if we really want to. |
@studix thank you very much for the effort, I highly appreciate it! @brandhuf it seems that the failing test is still is existent and reproducible on macOS when running debug tests (not in Release). Interesting is, that in Visual Studio Code the test is running in Release by default so I didn't found it out before. That's the message that I got: [xUnit.net 00:00:12.65] ArchUnitNETTests.Domain.PlantUml.ClassDiagramAssociationTest.ClassResidesInMultipleNamespaces [FAIL]
Fehler ArchUnitNETTests.Domain.PlantUml.ClassDiagramAssociationTest.ClassResidesInMultipleNamespaces [15 ms]
Fehlermeldung:
Assert.Equal() Failure
↓ (pos 102)
Expected: ···ut is contained in [A, B]
Actual: ···ut is contained in [B, A]
↑ (pos 102)
Stapelverfolgung:
at ArchUnitNETTests.Domain.PlantUml.ClassDiagramAssociationTest.ClassResidesInMultipleNamespaces() in /***/ArchUnitNET/ArchUnitNETTests/Domain/PlantUml/ClassDiagramAssociationTest.cs:line 105 |
Yes, my PR only fixed the failing test in CompilerGeneratedTypesTests. I ran the ClassResidesInMultipleNamespaces test multiple times in debug mode and it sometimes failed and sometimes passed. @studix Can you look into it? |
I thought this commit would fix it. But it seems that it's unrelated to MemoryStream/FileStream. I will have a look at it. |
ArchUnitNET.Domain.PlantUml:
new namespace which contains the PlantUML parser code ported from ArchUnit java
TypesShould / TypeConditionsDefinition:
contains new method AdhereToPlantUmlDiagram for PlantUML based dependency checks
ExampleArchUnitTestPuml demonstrates the feature