Skip to content

Commit

Permalink
Don't generate inline svg for publish tests.
Browse files Browse the repository at this point in the history
It's proved difficult to get plantuml to generate the same svg output on
all target platforms, due to font rendering differences effecting
various aspects of its output. This switches the test cases to use
embedded png output instead.
  • Loading branch information
robtaylor committed Oct 1, 2024
1 parent 04e01dc commit f8b0de2
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion doorstop/core/tests/files/REQ002.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ reviewed: 1PvBLmy0xmdK_zLKrLu1au0wlIw_zsD6A8Oc5F4zWxU=
text: |
Hello, world!
```plantuml format="svg_inline" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"
```plantuml format="png" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"
@startuml
Author --> (Create Document)
Author --> (Create Item)
Expand Down
2 changes: 1 addition & 1 deletion doorstop/core/tests/files/exported.csv
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type:file,path:external/text2.txt",REQ001:35ed54323e3054c33ae5545fffdbbbf5,True,
REQ004,1.6,"Hello, world!",,,,True,False,,True,
REQ002,2.1,"Hello, world!

```plantuml format=""svg_inline"" alt=""Use Cases of Doorstop"" title=""Use Cases of Doorstop""
```plantuml format=""png"" alt=""Use Cases of Doorstop"" title=""Use Cases of Doorstop""
@startuml
Author --> (Create Document)
Author --> (Create Item)
Expand Down
2 changes: 1 addition & 1 deletion doorstop/core/tests/files/exported.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type:file,path:external/text2.txt" REQ001:35ed54323e3054c33ae5545fffdbbbf5 True
REQ004 1.6 Hello, world! True False True
REQ002 2.1 "Hello, world!

```plantuml format=""svg_inline"" alt=""Use Cases of Doorstop"" title=""Use Cases of Doorstop""
```plantuml format=""png"" alt=""Use Cases of Doorstop"" title=""Use Cases of Doorstop""
@startuml
Author --> (Create Document)
Author --> (Create Item)
Expand Down
Binary file modified doorstop/core/tests/files/exported.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion doorstop/core/tests/files/exported.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ REQ002:
text: |
Hello, world!
```plantuml format="svg_inline" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"
```plantuml format="png" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"
@startuml
Author --> (Create Document)
Author --> (Create Item)
Expand Down
2 changes: 1 addition & 1 deletion doorstop/core/tests/files/published.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doorstop/core/tests/files/published.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Hello, world!

Hello, world!

```plantuml format="svg_inline" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"
```plantuml format="png" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"
@startuml
Author --> (Create Document)
Author --> (Create Item)
Expand Down
4 changes: 2 additions & 2 deletions doorstop/core/tests/files/published.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@

Hello, world!

```plantuml format="svg_inline" alt="Use Cases of Doorstop" title="Use
Cases of Doorstop"
```plantuml format="png" alt="Use Cases of Doorstop" title="Use Cases
of Doorstop"
@startuml
Author --> (Create Document)
Author --> (Create Item)
Expand Down
2 changes: 1 addition & 1 deletion doorstop/core/tests/files/published2.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doorstop/core/tests/files/published2.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Hello, world!

Hello, world!

```plantuml format="svg_inline" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"
```plantuml format="png" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"
@startuml
Author --> (Create Document)
Author --> (Create Item)
Expand Down
4 changes: 2 additions & 2 deletions doorstop/core/tests/files/published2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@

Hello, world!

```plantuml format="svg_inline" alt="Use Cases of Doorstop" title="Use
Cases of Doorstop"
```plantuml format="png" alt="Use Cases of Doorstop" title="Use Cases
of Doorstop"
@startuml
Author --> (Create Document)
Author --> (Create Item)
Expand Down
10 changes: 6 additions & 4 deletions doorstop/core/tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def test_issues_count(self):
issues = self.document.issues
for issue in self.document.issues:
logging.info(repr(issue))
self.assertEqual(13, len(issues))
self.assertEqual(14, len(issues))

@patch("doorstop.settings.REORDER", False)
@patch("doorstop.settings.REVIEW_NEW_ITEMS", False)
Expand Down Expand Up @@ -330,7 +330,7 @@ def test_issues_count(self):
issues = self.tree.issues
for issue in self.tree.issues:
logging.info(repr(issue))
self.assertEqual(15, len(issues))
self.assertEqual(16, len(issues))

@patch("doorstop.settings.REORDER", False)
@patch("doorstop.settings.REVIEW_NEW_ITEMS", False)
Expand Down Expand Up @@ -582,9 +582,11 @@ def setUp(self):
FILES, "plantuml-1.2024.7.jar"
)
plantuml_ext = next(
x for x in HtmlPublisher.EXTENSIONS if type(x) == PlantUMLMarkdownExtension
x for x in HtmlPublisher.EXTENSIONS if type(x) is PlantUMLMarkdownExtension
)
plantuml_ext.setConfigs(
{"server": "", "plantuml_cmd": plantuml_cmd, "theme": "bluegray"}
)
plantuml_ext.setConfigs({"server": "", "plantuml_cmd": plantuml_cmd})

def tearDown(self):
if os.path.exists(self.temp):
Expand Down
4 changes: 2 additions & 2 deletions doorstop/core/tests/test_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Inline Style 2: \\(ax^2 + bx + c = 0\\)
Multiline: $$x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.$$"""

PLANTUML_TXT = """```plantuml format="svg_inline" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"
PLANTUML_TXT = """```plantuml format="png" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"
@startuml
Author --> (Create Document)
Author --> (Create Item)
Expand Down Expand Up @@ -359,7 +359,7 @@ def test_file_xlsx(self, mock_itemize):
[
"REQ002",
"2.1",
'Hello, world!\n\n```plantuml format="svg_inline" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"\n@startuml\nAuthor --> (Create Document)\nAuthor --> (Create Item)\nAuthor --> (Link Item to Document)\nAuthor --> (Link Item to other Item)\nAuthor --> (Edit Item)\nAuthor --> (Review Item)\nAuthor -> (Delete Item)\nAuthor -> (Delete Document)\n(Export) <- (Author)\n(Import) <- (Author)\nReviewer --> (Review Item)\nSystem --> (Suspect Changes)\nSystem --> (Integrity)\n@enduml\n```',
'Hello, world!\n\n```plantuml format="png" alt="Use Cases of Doorstop" title="Use Cases of Doorstop"\n@startuml\nAuthor --> (Create Document)\nAuthor --> (Create Item)\nAuthor --> (Link Item to Document)\nAuthor --> (Link Item to other Item)\nAuthor --> (Edit Item)\nAuthor --> (Review Item)\nAuthor -> (Delete Item)\nAuthor -> (Delete Document)\n(Export) <- (Author)\n(Import) <- (Author)\nReviewer --> (Review Item)\nSystem --> (Suspect Changes)\nSystem --> (Integrity)\n@enduml\n```',
None,
None,
None,
Expand Down

0 comments on commit f8b0de2

Please sign in to comment.