Skip to content

Commit

Permalink
bail report on no data
Browse files Browse the repository at this point in the history
  • Loading branch information
eskerda committed Sep 17, 2024
1 parent 99325d2 commit 34eed96
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
39 changes: 19 additions & 20 deletions tests/test_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,36 @@
This is meant for red explicit fails on changes in CI
"""

import re
import os
import git
import inspect
def generate_tests_from_changes():
import re
import os
import git
import inspect

from warnings import warn
from importlib.util import spec_from_file_location, module_from_spec
from warnings import warn

from pytest import mark
from pytest import mark

from pybikes import BikeShareSystem
from pybikes.data import get_instances
from pybikes.compat import resources
from pybikes import BikeShareSystem
from pybikes.data import get_instances
from pybikes.compat import resources

from tests.test_instances import get_test_cls
from tests.test_instances import get_test_cls


def is_system(obj):
if not inspect.isclass(obj):
return False
def is_system(obj):
if not inspect.isclass(obj):
return False

if not issubclass(obj, BikeShareSystem):
return False
if not issubclass(obj, BikeShareSystem):
return False

if obj == BikeShareSystem:
return False
if obj == BikeShareSystem:
return False

return True
return True


def generate_tests_from_changes():
g = git.cmd.Git(os.getcwd())
changed_files = g.diff('--name-only', 'origin/master').splitlines()
clss = set()
Expand Down
4 changes: 4 additions & 0 deletions utils/github-summary.tpl.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# systems status report (Python {{ version }})

{% if systems %}
| overall success rate | {{ int((health.passed / health.total) * 100) }}% |
|-|-|
| passed | {{ health.passed }} |
Expand Down Expand Up @@ -55,3 +56,6 @@
{% endfor %}
{% endfor %}
{% endfor %}
{% else %}
No systems
{% endif %}
4 changes: 4 additions & 0 deletions utils/report.tpl.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# systems status report (Python {{ version }})
{% if systems %}

| overall success rate | {{ int((health.passed / health.total) * 100) }}% |
|-|-|
Expand Down Expand Up @@ -54,3 +55,6 @@
{% endfor %}
{% endfor %}
{% endfor %}
{% else %}
No systems
{% endif %}

0 comments on commit 34eed96

Please sign in to comment.