From a2a63b763ab3199398d06304ffd82f0bcaa54013 Mon Sep 17 00:00:00 2001 From: Florian Scherf Date: Fri, 9 Feb 2024 23:53:25 +0100 Subject: [PATCH 1/4] tests: pytest: set test timeout to 300 seconds We had hanging test-suites in CI before. If possible we want to cancel the test-suite ourself in these cases, to get at least a little bit of debug information. Signed-off-by: Florian Scherf --- pytest.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/pytest.ini b/pytest.ini index 64b2c48..b0f2aab 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,3 +4,4 @@ log_cli = false log_level = NOTSET log_format = %(levelname)-8s %(name)-30s [%(asctime)s.%(msecs)03d] %(message)s log_date_format = %H:%M:%S +timeout = 300 From b7aab6a0dbc6147ad9e34ae5c619697d80c259ea Mon Sep 17 00:00:00 2001 From: Florian Scherf Date: Fri, 9 Feb 2024 23:58:20 +0100 Subject: [PATCH 2/4] tests: fix ci-test make target The JENKINS_URL mechanism in tox seemingly stopped working. This patch updates the make file to just provide all ci environments to tox in the ci-test target. Signed-off-by: Florian Scherf --- Makefile | 2 +- tox.ini | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0793094..036706d 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ test: | $(PYTHON_ENV) ci-test: | $(PYTHON_ENV) . $(PYTHON_ENV)/bin/activate && \ - MILAN_CI_TEST=1 tox $(args) + MILAN_CI_TEST=1 tox -e py38,py39,py310,py311 $(args) frontend: | $(PYTHON_ENV) . $(PYTHON_ENV)/bin/activate && \ diff --git a/tox.ini b/tox.ini index b5ceab6..6246e45 100644 --- a/tox.ini +++ b/tox.ini @@ -3,10 +3,6 @@ skip_missing_interpreters = True envlist = py310 -[tox:jenkins] -envlist = lint,py38,py39,py310,py311 - - [testenv] passenv = MILAN_* From 9292ef82963cc7d4ed904d6684642ee07bd521c3 Mon Sep 17 00:00:00 2001 From: Florian Scherf Date: Fri, 9 Feb 2024 23:47:45 +0100 Subject: [PATCH 3/4] utils: json rpc: fix incompatibility with Python<3.10 All `asyncio.Queue` versions, prior to Python 3.10, require the `loop` argument, if multiple loops are running in one system. Signed-off-by: Florian Scherf --- milan/utils/json_rpc.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/milan/utils/json_rpc.py b/milan/utils/json_rpc.py index c41a334..f054d72 100644 --- a/milan/utils/json_rpc.py +++ b/milan/utils/json_rpc.py @@ -5,6 +5,7 @@ import asyncio import queue import json +import sys import os from aiohttp import ClientSession, WSMsgType @@ -417,8 +418,14 @@ def __init__(self, loop, url): self._stopped = asyncio.Future(loop=self.loop) self._websocket_open = asyncio.Future(loop=self.loop) self._websocket = None - self._read_queue = asyncio.Queue() - self._write_queue = asyncio.Queue() + + if sys.version_info < (3, 10): + self._read_queue = asyncio.Queue(loop=self.loop) + self._write_queue = asyncio.Queue(loop=self.loop) + + else: + self._read_queue = asyncio.Queue() + self._write_queue = asyncio.Queue() self.loop.create_task(coro=self._handle_read_queue()) self.loop.create_task(coro=self._handle_write_queue()) From 958b86dbff0e26e1b9b4c7084f83122cd1f03e71 Mon Sep 17 00:00:00 2001 From: Florian Scherf Date: Wed, 7 Feb 2024 23:58:54 +0100 Subject: [PATCH 4/4] github: workflows: ci: test: setup artifacts Signed-off-by: Florian Scherf --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3ec511..7895080 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,3 +40,9 @@ jobs: uses: codecov/codecov-action@v3 with: file: ./coverage.xml + + - name: Upload artifacts to GitHub + uses: actions/upload-artifact@v4 + with: + name: python-${{ matrix.python-version }}-artifacts + path: tests/artifacts