Skip to content

Commit 6b40082

Browse files
authored
Merge branch 'master' into pr/01
2 parents c7d9199 + a7770fa commit 6b40082

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

09-coap/test_spec09.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def coap_get(
3636
cmd = "coap get "
3737
if confirmable:
3838
cmd += "-c "
39-
cmd += f"[{addr}]:{port:d} {resource}"
39+
cmd += f"coap://[{addr}]:{port:d}{resource}"
4040
return self.cmd(cmd, timeout=timeout, async_=async_)
4141

4242

conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
See https://docs.pytest.org/en/stable/fixture.html#conftest-py-sharing-fixture-functions
77
""" # noqa: E501
88

9+
import random
910
import re
1011
import os
1112
import subprocess
@@ -29,6 +30,7 @@
2930
RIOTBASE = os.environ.get('RIOTBASE')
3031
RUNNING_CTRLS = []
3132
RUNNING_EXPERIMENTS = []
33+
DEFAULT_PAN_ID = str(random.randint(0, 0xFFFD))
3234

3335

3436
def pytest_addoption(parser):
@@ -279,6 +281,10 @@ def nodes(local, request, boards, iotlab_site):
279281
for board in boards:
280282
if local or only_native or IoTLABExperiment.valid_board(board):
281283
env = {'BOARD': f'{board}'}
284+
if only_native:
285+
# XXX this does not work for a mix of native and non-native boards,
286+
# but we do not have these in the release tests at the moment.
287+
env["RIOT_TERMINAL"] = "native"
282288
else:
283289
env = {
284290
'BOARD': IoTLABExperiment.board_from_iotlab_node(board),
@@ -317,6 +323,12 @@ def update_env(node, modules=None, cflags=None, port=None, termflags=None, extra
317323
node.env.get('DOCKER_ENVIRONMENT_CMDLINE', '')
318324
+ f" -e 'USEMODULE={node.env['USEMODULE']}'"
319325
)
326+
node.env['DEFAULT_PAN_ID'] = DEFAULT_PAN_ID
327+
if os.environ.get('BUILD_IN_DOCKER', 0) == '1':
328+
node.env['DOCKER_ENVIRONMENT_CMDLINE'] = (
329+
node.env.get('DOCKER_ENVIRONMENT_CMDLINE', '')
330+
+ f" -e 'DEFAULT_PAN_ID={node.env['DEFAULT_PAN_ID']}'"
331+
)
320332
if cflags is not None:
321333
node.env['CFLAGS'] = cflags
322334
if port is not None:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ pytest-cov
1010
pytest-rerunfailures
1111
riotctrl
1212
scapy
13-
paho-mqtt
13+
paho-mqtt<2

testutils/github.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import urllib.parse
55

66
from bs4 import BeautifulSoup
7-
from github import Github, GithubException, InputFileContent
7+
from github import Auth, Github, GithubException, InputFileContent
88

99
from testutils.git import Git, GitError
1010

@@ -80,7 +80,7 @@ def get_github():
8080
access_token = get_access_token()
8181
if not access_token:
8282
return None
83-
return Github(access_token, base_url=API_URL)
83+
return Github(auth=Auth.Token(access_token), base_url=API_URL)
8484

8585

8686
def get_repo(github):
@@ -210,9 +210,9 @@ def create_comment(github, issue):
210210
def _generate_outcome_summary(pytest_report, task):
211211
# pylint: disable=C0209
212212
return "<strong>{a_open}{outcome}{a_close}</strong>".format(
213-
a_open='<a href="{}">'.format(task["outcome_url"])
214-
if "outcome_url" in task
215-
else '',
213+
a_open=(
214+
'<a href="{}">'.format(task["outcome_url"]) if "outcome_url" in task else ''
215+
),
216216
outcome=pytest_report.outcome.upper(),
217217
a_close='</a>' if "outcome_url" in task else '',
218218
)

testutils/tests/test_github.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ def __init__(self, issues):
134134

135135
# pylint: disable=W0613
136136
def get_issues(self, *args, **kwargs):
137-
for issue in self.issues:
138-
yield issue
137+
yield from self.issues
139138

140139
issues = [MockIssue(title) for title in issue_titles]
141140
repo = MockRepo(issues)
@@ -983,9 +982,11 @@ def test_upload_results(
983982
monkeypatch.setattr(
984983
testutils.github,
985984
"get_results_gist",
986-
lambda *args, **kwargs: (testutils.github.Git('.'), "", "the_gist_id")
987-
if gist_created
988-
else (None, None, None),
985+
lambda *args, **kwargs: (
986+
(testutils.github.Git('.'), "", "the_gist_id")
987+
if gist_created
988+
else (None, None, None)
989+
),
989990
)
990991
monkeypatch.setattr(
991992
testutils.github, "upload_result_content", lambda *args, **kwargs: head

0 commit comments

Comments
 (0)