Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download test results
uses: dawidd6/action-download-artifact@v18
uses: dawidd6/action-download-artifact@v21
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
pull-requests: write
steps:
- name: Check out
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Run synchronization to Jira
uses: espressif/sync-jira-actions@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test-build-docs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
test-build-packages:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
timeout-minutes: 40
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.14"
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
image: python:${{ matrix.python-version }}
options: --privileged
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
- name: Install dependencies
run: |
apt update && apt install -y socat zip
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
- id: mixed-line-ending
args: ["-f=lf"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.15.6"
rev: "v0.15.20"
hooks:
- id: ruff-check
args: ["--fix"]
Expand Down
7 changes: 5 additions & 2 deletions pytest-embedded-arduino/pytest_embedded_arduino/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class ArduinoApp(App):
flash_settings (dict[str, str]): Flash settings for the target.
flash_files (list[tuple[str, str]]): ``(address, filepath)`` pairs parsed
from ``flash_args``. Each filepath is absolute.
binary_file (str): Merged binary file path.
binary_file (str): Application binary file path (``.ino.merged.bin`` if present,
otherwise ``.ino.bin``).
elf_file (str): ELF file path.
"""

Expand All @@ -35,7 +36,9 @@ def __init__(
self.fqbn = self._get_fqbn(self.binary_path)
self.target = self.fqbn.split(':')[2]
self.flash_settings, self.flash_files = self._parse_flash_args()
self.binary_file = os.path.realpath(os.path.join(self.binary_path, self.sketch + '.ino.merged.bin'))
merged_bin = os.path.realpath(os.path.join(self.binary_path, self.sketch + '.ino.merged.bin'))
ino_bin = os.path.realpath(os.path.join(self.binary_path, self.sketch + '.ino.bin'))
self.binary_file = merged_bin if os.path.exists(merged_bin) else ino_bin
self.elf_file = os.path.realpath(os.path.join(self.binary_path, self.sketch + '.ino.elf'))

logging.debug(f'Build path: {self.binary_path}')
Expand Down
5 changes: 4 additions & 1 deletion pytest-embedded-arduino/tests/test_arduino.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@


def test_arduino_serial_flash(testdir):
bin_path = os.path.join(testdir.tmpdir, 'hello_world_arduino', 'build', 'hello_world_arduino.ino.merged.bin')
build_dir = os.path.join(testdir.tmpdir, 'hello_world_arduino', 'build')
merged_bin = os.path.join(build_dir, 'hello_world_arduino.ino.merged.bin')
ino_bin = os.path.join(build_dir, 'hello_world_arduino.ino.bin')
bin_path = merged_bin if os.path.exists(merged_bin) else ino_bin

testdir.makepyfile(f"""
import pexpect
Expand Down
12 changes: 8 additions & 4 deletions pytest-embedded/pytest_embedded/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
_T = t.TypeVar('_T')


def pytest_addoption(parser):
def pytest_addoption(parser: pytest.Parser):
base_group = parser.getgroup('embedded')
base_group.addoption(
'--count',
Expand Down Expand Up @@ -1415,7 +1415,7 @@ def pytest_collection_modifyitems(self, config: Config, items: list[Function]):

from esp_bool_parser import parse_bool_expr

target = config.getoption('--target', None)
target = config.getoption('target', None)
if hasattr(item, 'callspec'):
target = item.callspec.params.get('target', None)
if target == 'auto' or not isinstance(target, str):
Expand Down Expand Up @@ -1491,7 +1491,7 @@ def pytest_runtest_call(self, item: Function):
self._raise_dut_failed_cases_if_exists(all_duts) # type: ignore

@pytest.hookimpl(trylast=True) # combine all possible junit reports should be the last step
def pytest_sessionfinish(self, session: Session, exitstatus: int) -> None:
def pytest_sessionfinish(self, session: Session) -> None:
modifier: JunitMerger = session.config.stash[_junit_merger_key]
_stash_session_tempdir = session.config.stash.get(_session_tempdir_key, None)
_stash_junit_report_path = session.config.stash.get(_junit_report_path_key, None)
Expand All @@ -1509,4 +1509,8 @@ def pytest_sessionfinish(self, session: Session, exitstatus: int) -> None:
if self.prettify_junit_report:
_prettify_xml(_stash_junit_report_path)

exitstatus = int(modifier.failed) # True -> 1 False -> 0 # noqa
# escalate the session exit status to failure if the merged junit report contains failures,
# without downgrading an already-failing run
current_exitstatus = getattr(session, 'exitstatus', pytest.ExitCode.OK)
if modifier.failed and current_exitstatus == pytest.ExitCode.OK:
session.exitstatus = pytest.ExitCode.TESTS_FAILED
Comment thread
Copilot marked this conversation as resolved.