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

Write svg in json tests for debug #187

Merged
merged 5 commits into from Dec 10, 2020
Merged

Conversation

flo-dup
Copy link
Contributor

@flo-dup flo-dup commented Nov 4, 2020

Please check if the PR fulfills these requirements (please use '[x]' to check the checkboxes, or submit the PR and then click the checkboxes)

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem ?
No.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature

What is the current behavior? (You can also link to an open issue here)
One cannot easily generate all svg files related to json reference test files (which sometimes correspond to not-so-good diagrams) to see whether the reference is ok, and when changing the reference file whether that change is not unexpectedly changing the diagram rendering.

What is the new behavior (if this is a feature change)?
If writeFile parameter is true in AbstractTestCase, all json tests inheriting from AbstractTestCase will generate the corresponding svg file.

Does this PR introduce a breaking change or deprecate an API?
No

Other information:
Note that this had already been done by @BenoitJeanson for tests extending AbstractTestCaseRaw, this PR simply extends this behaviour to all tests extending AbstractTestCase

@flo-dup flo-dup requested review from geofjamg and BenoitJeanson and removed request for geofjamg November 4, 2020 16:16
@flo-dup flo-dup force-pushed the debug_write_svg_in_json_tests branch from 1f33ac7 to 8d33028 Compare November 13, 2020 16:07
@@ -61,7 +61,7 @@ public void test() {
new BlockOrganizer().organize(g);

// calculate coordinates
LayoutParameters layoutParameters = new LayoutParameters()
layoutParameters = new LayoutParameters()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not very important but it is probably a little bit weak as a design. Maybe just have an abstract LayoutParameters getLayoutParameter() in the base class?

@flo-dup flo-dup requested a review from geofjamg December 3, 2020 09:24
Used for debug purposes, checking the look of the corresponding SVG

Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
- Replacing all new LayoutParameters in tests by getLayoutParameters
- Factorizing same LayoutParameters with createDefaultLayoutParameters()

Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
@flo-dup flo-dup force-pushed the debug_write_svg_in_json_tests branch 2 times, most recently from 0e59963 to 1ed1deb Compare December 9, 2020 08:51
In order to generate all svg files even if one test fails

Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
@flo-dup flo-dup force-pushed the debug_write_svg_in_json_tests branch from 1ed1deb to 0ffc22b Compare December 9, 2020 08:54
@sonarcloud
Copy link

sonarcloud bot commented Dec 9, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

warning The version of Java (1.8.0_275) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 11.
Read more here

@flo-dup flo-dup merged commit 96034d4 into master Dec 10, 2020
@flo-dup flo-dup deleted the debug_write_svg_in_json_tests branch December 10, 2020 08:16
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.

None yet

2 participants