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 ci #21

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
67 changes: 51 additions & 16 deletions .github/workflows/pythonpackage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,54 @@ jobs:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tests, flake8 and mypy
run: |
tox
- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v3"
with:
fail_ci_if_error: true
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox

- name: Setup network interfaces
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
set -x
sudo ip link add type veth
sudo ip link set dev veth0 address 02:00:00:00:00:00 name feth0
sudo ip link set dev veth1 address 02:00:00:00:00:01 name feth1
sudo ip link set up dev feth0
sudo ip link set up dev feth1
sudo ip addr show dev feth0
sudo ip addr show dev feth1

- name: Setup network interfaces
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
set -x
# it looks like macos will only assign the link-local address
# when another address was assigned?? let's just directly assign our
# fixed LL addresses here directly
sudo ifconfig feth0 create lladdr 02:00:00:00:00:00
sudo ifconfig feth1 create lladdr 02:00:00:00:00:01
sudo ifconfig feth0 peer feth1
sudo ifconfig feth0 inet6 fd00::0
sudo ifconfig feth1 inet6 fd00::1
sudo ifconfig feth0 up
sudo ifconfig feth1 up
sudo ifconfig feth0
sudo ifconfig feth1

- name: Run tests, flake8 and mypy
run: |
false
tox

- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v4"
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions src/someip/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def wrapper(self, *args, **kwargs):
return await f(self, *args, **kwargs)
except Exception:
self.log.exception(
msg.format(__func__=f.__qualname__, *args, **kwargs)
msg.format(*args, __func__=f.__qualname__, **kwargs)
)

else:
Expand All @@ -36,7 +36,7 @@ def wrapper(self, *args, **kwargs):
return f(self, *args, **kwargs)
except Exception:
self.log.exception(
msg.format(__func__=f.__qualname__, *args, **kwargs)
msg.format(*args, __func__=f.__qualname__, **kwargs)
)

return wrapper
Expand Down
24 changes: 12 additions & 12 deletions tests/test_sd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2377,27 +2377,27 @@ class TestMulticastEndpointsV6(
required setup on Linux:

ip link add type veth
ip link set dev veth0 address 02:00:00:00:00:00
ip link set dev veth1 address 02:00:00:00:00:01
ip link set up dev veth0
ip link set up dev veth1
ip link set dev veth0 address 02:00:00:00:00:00 name feth0
ip link set dev veth1 address 02:00:00:00:00:01 name feth1
ip link set up dev feth0
ip link set up dev feth1
"""

bind_lo_addr = "fe80::ff:fe00:0%veth0"
sender_lo_addr = "fe80::ff:fe00:1%veth0"
send_addr = "fe80::ff:fe00:0%veth1"
bind_mc_addr = "ff02::dead:beef%veth0"
send_mc_addr = "ff02::dead:beef%veth1"
bind_interface = "veth0"
send_interface = "veth1"
bind_lo_addr = "fe80::ff:fe00:0%feth0"
sender_lo_addr = "fe80::ff:fe00:1%feth0"
send_addr = "fe80::ff:fe00:0%feth1"
bind_mc_addr = "ff02::dead:beef%feth0"
send_mc_addr = "ff02::dead:beef%feth1"
bind_interface = "feth0"
send_interface = "feth1"
AF = socket.AF_INET6

def setUp(self):
try:
socket.if_nametoindex(self.bind_interface)
socket.if_nametoindex(self.send_interface)
except OSError as exc:
raise unittest.SkipTest("test interfaces veth0 / veth1 not up") from exc
raise unittest.SkipTest("test interfaces feth0 / feth1 not up") from exc

def _mc_sockopts(self, sock: socket.socket) -> None:
ifindex = socket.if_nametoindex(self.send_interface)
Expand Down
2 changes: 1 addition & 1 deletion tools/find-subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def auto_int(s):

def setup_log(fmt="", **kwargs):
try:
import coloredlogs # type: ignore[import]
import coloredlogs # type: ignore[import-not-found]
coloredlogs.install(fmt="%(asctime)s,%(msecs)03d " + fmt, **kwargs)
except ModuleNotFoundError:
logging.basicConfig(format="%(asctime)s " + fmt, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion tools/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def auto_int(s):

def setup_log(fmt="", **kwargs):
try:
import coloredlogs # type: ignore[import]
import coloredlogs # type: ignore[import-not-found]
coloredlogs.install(fmt="%(asctime)s,%(msecs)03d " + fmt, **kwargs)
except ModuleNotFoundError:
logging.basicConfig(format="%(asctime)s " + fmt, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion tools/monitor-sd.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def auto_int(s):

def setup_log(fmt="", **kwargs):
try:
import coloredlogs # type: ignore[import]
import coloredlogs # type: ignore[import-not-found]
coloredlogs.install(fmt="%(asctime)s,%(msecs)03d " + fmt, **kwargs)
except ModuleNotFoundError:
logging.basicConfig(format="%(asctime)s " + fmt, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion tools/simpleservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def run(local_addr, multicast_addr, port):

def setup_log(fmt="", **kwargs):
try:
import coloredlogs # type: ignore[import]
import coloredlogs # type: ignore[import-not-found]

coloredlogs.install(fmt="%(asctime)s,%(msecs)03d " + fmt, **kwargs)
except ModuleNotFoundError:
Expand Down
Loading