From df3191c2fe3df7ae864437947e5bc67fd29f58bd Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Mon, 8 Jan 2024 16:47:56 +0100 Subject: [PATCH 1/7] conftest: use "native" RIOT_TERMINAL for native boards --- conftest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conftest.py b/conftest.py index 62b7545..e6aae43 100644 --- a/conftest.py +++ b/conftest.py @@ -279,6 +279,10 @@ def nodes(local, request, boards, iotlab_site): for board in boards: if local or only_native or IoTLABExperiment.valid_board(board): env = {'BOARD': f'{board}'} + if only_native: + # XXX this does not work for a mix of native and non-native boards, + # but we do not have these in the release tests at the moment. + env["RIOT_TERMINAL"] = "native" else: env = { 'BOARD': IoTLABExperiment.board_from_iotlab_node(board), From 325a0007aceda13d5b4fe13995a1cc6c0f607aca Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Mon, 29 Jan 2024 12:24:42 +0100 Subject: [PATCH 2/7] testutils: Fix black style --- testutils/github.py | 6 +++--- testutils/tests/test_github.py | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/testutils/github.py b/testutils/github.py index d59761c..7d95fc2 100644 --- a/testutils/github.py +++ b/testutils/github.py @@ -210,9 +210,9 @@ def create_comment(github, issue): def _generate_outcome_summary(pytest_report, task): # pylint: disable=C0209 return "{a_open}{outcome}{a_close}".format( - a_open=''.format(task["outcome_url"]) - if "outcome_url" in task - else '', + a_open=( + ''.format(task["outcome_url"]) if "outcome_url" in task else '' + ), outcome=pytest_report.outcome.upper(), a_close='' if "outcome_url" in task else '', ) diff --git a/testutils/tests/test_github.py b/testutils/tests/test_github.py index 824abe2..e3930b3 100644 --- a/testutils/tests/test_github.py +++ b/testutils/tests/test_github.py @@ -983,9 +983,11 @@ def test_upload_results( monkeypatch.setattr( testutils.github, "get_results_gist", - lambda *args, **kwargs: (testutils.github.Git('.'), "", "the_gist_id") - if gist_created - else (None, None, None), + lambda *args, **kwargs: ( + (testutils.github.Git('.'), "", "the_gist_id") + if gist_created + else (None, None, None) + ), ) monkeypatch.setattr( testutils.github, "upload_result_content", lambda *args, **kwargs: head From cdf7accca6d15e14cb329a27d3792ea096ec81c7 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Wed, 31 Jan 2024 12:46:02 +0100 Subject: [PATCH 3/7] testutils: Avoid deprecated parameter --- testutils/github.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testutils/github.py b/testutils/github.py index 7d95fc2..1b81f26 100644 --- a/testutils/github.py +++ b/testutils/github.py @@ -4,7 +4,7 @@ import urllib.parse from bs4 import BeautifulSoup -from github import Github, GithubException, InputFileContent +from github import Auth, Github, GithubException, InputFileContent from testutils.git import Git, GitError @@ -80,7 +80,7 @@ def get_github(): access_token = get_access_token() if not access_token: return None - return Github(access_token, base_url=API_URL) + return Github(auth=Auth.Token(access_token), base_url=API_URL) def get_repo(github): From abc6ed7391cf7a918488a6dfb30cd81d1618c600 Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 31 Jan 2024 09:45:19 +0100 Subject: [PATCH 4/7] conftest: Randomize default PAN_ID Due to some issues with other border routers running we should harden the tests against that by using a random PAN_ID. --- conftest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/conftest.py b/conftest.py index e6aae43..f40a3fc 100644 --- a/conftest.py +++ b/conftest.py @@ -6,6 +6,7 @@ See https://docs.pytest.org/en/stable/fixture.html#conftest-py-sharing-fixture-functions """ # noqa: E501 +import random import re import os import subprocess @@ -29,6 +30,7 @@ RIOTBASE = os.environ.get('RIOTBASE') RUNNING_CTRLS = [] RUNNING_EXPERIMENTS = [] +DEFAULT_PAN_ID = str(random.randint(0, 0xFFFD)) def pytest_addoption(parser): @@ -321,6 +323,12 @@ def update_env(node, modules=None, cflags=None, port=None, termflags=None, extra node.env.get('DOCKER_ENVIRONMENT_CMDLINE', '') + f" -e 'USEMODULE={node.env['USEMODULE']}'" ) + node.env['DEFAULT_PAN_ID'] = DEFAULT_PAN_ID + if os.environ.get('BUILD_IN_DOCKER', 0) == '1': + node.env['DOCKER_ENVIRONMENT_CMDLINE'] = ( + node.env.get('DOCKER_ENVIRONMENT_CMDLINE', '') + + f" -e 'DEFAULT_PAN_ID={node.env['DEFAULT_PAN_ID']}'" + ) if cflags is not None: node.env['CFLAGS'] = cflags if port is not None: From 834a1e05cfa7804a36d8c286b94d35a13276864f Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Wed, 21 Feb 2024 13:24:44 +0100 Subject: [PATCH 5/7] requirements.txt: pin paho to <2.0.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e71cc56..281ef21 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,4 @@ pytest-cov pytest-rerunfailures riotctrl scapy -paho-mqtt +paho-mqtt<2 From 6e59006955452fd51091cad863c5b1964a890151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikolai=20G=C3=BCtschow?= Date: Mon, 17 Jun 2024 11:49:33 +0200 Subject: [PATCH 6/7] testutils: fix use-yield-from for pylint --- testutils/tests/test_github.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testutils/tests/test_github.py b/testutils/tests/test_github.py index e3930b3..f6157dd 100644 --- a/testutils/tests/test_github.py +++ b/testutils/tests/test_github.py @@ -134,8 +134,7 @@ def __init__(self, issues): # pylint: disable=W0613 def get_issues(self, *args, **kwargs): - for issue in self.issues: - yield issue + yield from self.issues issues = [MockIssue(title) for title in issue_titles] repo = MockRepo(issues) From 21a3af5a5cf9c3f0fd217d7c952225fda43c1dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikolai=20G=C3=BCtschow?= Date: Mon, 17 Jun 2024 11:31:36 +0200 Subject: [PATCH 7/7] 09-coap: pass URI instead of separate host and path components adapts the release spec to the changes from https://github.com/RIOT-OS/RIOT/pull/20554 --- 09-coap/test_spec09.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/09-coap/test_spec09.py b/09-coap/test_spec09.py index 55fbc01..ab3251b 100644 --- a/09-coap/test_spec09.py +++ b/09-coap/test_spec09.py @@ -36,7 +36,7 @@ def coap_get( cmd = "coap get " if confirmable: cmd += "-c " - cmd += f"[{addr}]:{port:d} {resource}" + cmd += f"coap://[{addr}]:{port:d}{resource}" return self.cmd(cmd, timeout=timeout, async_=async_)