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

Fix codecov and test failures #662

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/change-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
python-version: "3.11"
architecture: x64

- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '21'

- uses: Gr1N/setup-poetry@v8

- name: Check system dependencies
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/execute-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ on:
workpath:
required: true
type: string
secrets:
CODECOV_TOKEN:
required: true

jobs:
test:
runs-on: ${{ inputs.os }}
strategy:
fail-fast: false
fail-fast: true
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
name: Python ${{ matrix.python-version }}
Expand All @@ -43,6 +46,11 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: x64

- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '21'

- uses: Gr1N/setup-poetry@v8

- name: Check system dependencies
Expand All @@ -56,18 +64,9 @@ jobs:
- name: Install project dependencies
run: make install

# Some tests fails intermittently, likely due to the public runners being
# very slow. Especially any client/server tests seems to be problematic.
# This is a simple attempt to re-run the tests up to three times if they
# fail. Does not add any execution time if successful.
- uses: Wandalen/wretry.action@v1.4.4
name: Run tests
with:
command: make test
current_path: ${{ inputs.workpath }}
attempt_limit: 5
attempt_delay: 2000

- name: Run tests
run: make test

- name: Upload coverage
uses: codecov/codecov-action@v4
if: ${{ inputs.os == 'ubuntu-latest' && matrix.python-version == '3.9' && github.repository == 'doorstop-dev/doorstop' }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ jobs:
with:
os: "ubuntu-latest"
workpath: "/home/runner/work/doorstop/doorstop"

Test:
uses: ./.github/workflows/execute-tests.yml
with:
os: "ubuntu-latest"
workpath: "/home/runner/work/doorstop/doorstop"
secrets:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
2 changes: 2 additions & 0 deletions .github/workflows/test-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ jobs:
with:
os: "macos-13"
workpath: "/Users/runner/work/doorstop/doorstop"
secrets:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
2 changes: 2 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ jobs:
basepath: 'D:\'
os: "windows-latest"
workpath: 'C:\a\doorstop\doorstop'
secrets:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
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
Binary file added doorstop/core/tests/files/plantuml-1.2024.7.jar
Binary file not shown.
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
16 changes: 14 additions & 2 deletions doorstop/core/tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@

import openpyxl
import yaml
from plantuml_markdown import PlantUMLMarkdownExtension

from doorstop import common, core
from doorstop.common import DoorstopError, DoorstopInfo, DoorstopWarning
from doorstop.core.builder import _clear_tree, _get_tree
from doorstop.core.publishers.html import HtmlPublisher
from doorstop.core.tests import (
EMPTY,
ENV,
Expand Down Expand Up @@ -172,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 @@ -328,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 @@ -575,6 +577,16 @@ def setUp(self):
self.tree = core.build(cwd=FILES, root=FILES)
self.document = self.tree.find_document("REQ")
self.temp = tempfile.mkdtemp()
# Use local plantuml of known version
plantuml_cmd = "java -Dplantuml.include.path=includes -jar " + os.path.join(
FILES, "plantuml-1.2024.7.jar"
)
plantuml_ext = next(
x for x in HtmlPublisher.EXTENSIONS if type(x) is PlantUMLMarkdownExtension
)
plantuml_ext.setConfigs(
{"server": "", "plantuml_cmd": plantuml_cmd, "theme": "bluegray"}
)

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
Loading