test_*.py files are no longer executable (#32610)

* test_*.py files are no longer executable

* cleanup empty lines

* update precommit

* fixme

* enable

* build
old-commit-hash: c59887c810
This commit is contained in:
Adeeb Shihadeh 2024-06-03 15:48:56 -07:00 committed by GitHub
parent 60ed5d6d40
commit 86b6103657
78 changed files with 5 additions and 85 deletions

View File

@ -116,6 +116,8 @@ jobs:
submodules: true
- uses: ./.github/workflows/setup-pre-commit
- uses: ./.github/workflows/setup-with-retry
- name: Build openpilot
run: ${{ env.RUN }} "scons -j$(nproc)"
- name: pre-commit
timeout-minutes: 4
run: ${{ env.RUN }} "unset PYTHONWARNINGS && pre-commit run --all && chmod -R 777 /tmp/pre-commit"
@ -143,7 +145,7 @@ jobs:
$PYTEST --timeout 60 -m 'not slow' && \
./selfdrive/ui/tests/create_test_translations.sh && \
QT_QPA_PLATFORM=offscreen ./selfdrive/ui/tests/test_translations && \
./selfdrive/ui/tests/test_translations.py"
pytest ./selfdrive/ui/tests/test_translations.py"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v4
with:

View File

@ -86,8 +86,8 @@ repos:
hooks:
- id: test_translations
name: test translations
entry: selfdrive/ui/tests/test_translations.py
language: script
entry: pytest selfdrive/ui/tests/test_translations.py
language: system
pass_filenames: false
files: '^selfdrive/ui/translations/'
- repo: https://github.com/python-poetry/poetry

2
common/transformations/tests/test_coordinates.py Executable file → Normal file
View File

@ -1,5 +1,3 @@
#!/usr/bin/env python3
import numpy as np
import openpilot.common.transformations.coordinates as coord

2
common/transformations/tests/test_orientation.py Executable file → Normal file
View File

@ -1,5 +1,3 @@
#!/usr/bin/env python3
import numpy as np
from openpilot.common.transformations.orientation import euler2quat, quat2euler, euler2rot, rot2euler, \

1
selfdrive/boardd/tests/test_boardd_loopback.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import copy
import random

1
selfdrive/boardd/tests/test_boardd_spi.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import time
import numpy as np

1
selfdrive/boardd/tests/test_pandad.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import pytest
import time

1
selfdrive/car/ford/tests/test_ford.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import random
from collections.abc import Iterable

1
selfdrive/car/gm/tests/test_gm.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
from parameterized import parameterized
from openpilot.selfdrive.car.gm.fingerprints import FINGERPRINTS

1
selfdrive/car/honda/tests/test_honda.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import re
from openpilot.selfdrive.car.honda.fingerprints import FW_VERSIONS

1
selfdrive/car/hyundai/tests/test_hyundai.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
from hypothesis import settings, given, strategies as st
import pytest

1
selfdrive/car/tests/test_can_fingerprint.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
from parameterized import parameterized
from cereal import log, messaging

1
selfdrive/car/tests/test_car_interfaces.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import math
import hypothesis.strategies as st

1
selfdrive/car/tests/test_docs.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
from collections import defaultdict
import os
import pytest

1
selfdrive/car/tests/test_fingerprints.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import sys

1
selfdrive/car/tests/test_fw_fingerprint.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import random
import time

1
selfdrive/car/tests/test_lateral_limits.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
from collections import defaultdict
import importlib
from parameterized import parameterized_class

1
selfdrive/car/tests/test_models.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import capnp
import os
import importlib

2
selfdrive/car/tests/test_platform_configs.py Executable file → Normal file
View File

@ -1,5 +1,3 @@
#!/usr/bin/env python3
from openpilot.selfdrive.car.values import PLATFORMS

1
selfdrive/car/toyota/tests/test_toyota.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
from hypothesis import given, settings, strategies as st
from cereal import car

1
selfdrive/car/volkswagen/tests/test_volkswagen.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import random
import re

1
selfdrive/controls/lib/tests/test_alertmanager.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import random
from openpilot.selfdrive.controls.lib.events import Alert, EVENTS

1
selfdrive/controls/lib/tests/test_latcontrol.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
from parameterized import parameterized
from cereal import car, log

1
selfdrive/controls/lib/tests/test_vehicle_model.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import math

1
selfdrive/controls/tests/test_alerts.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import copy
import json
import os

1
selfdrive/controls/tests/test_cruise_speed.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import itertools
import numpy as np

1
selfdrive/controls/tests/test_following_distance.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import itertools
from parameterized import parameterized_class

1
selfdrive/controls/tests/test_leads.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import cereal.messaging as messaging
from openpilot.selfdrive.test.process_replay import replay_process_with_name

2
selfdrive/controls/tests/test_state_machine.py Executable file → Normal file
View File

@ -1,5 +1,3 @@
#!/usr/bin/env python3
from cereal import car, log
from openpilot.common.realtime import DT_CTRL
from openpilot.selfdrive.car.car_helpers import interfaces

1
selfdrive/debug/test_fw_query_on_routes.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
# type: ignore
from collections import defaultdict

1
selfdrive/locationd/test/test_calibrationd.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import random
import numpy as np

1
selfdrive/locationd/test/test_locationd.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import json
import random

1
selfdrive/locationd/test/test_locationd_scenarios.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import numpy as np
from collections import defaultdict

1
selfdrive/modeld/tests/test_modeld.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import numpy as np
import random

1
selfdrive/monitoring/test_monitoring.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import numpy as np
from cereal import car, log

1
selfdrive/navd/tests/test_map_renderer.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import time
import numpy as np
import os

1
selfdrive/navd/tests/test_navd.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import json
import random
import numpy as np

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import itertools
from parameterized import parameterized_class

1
selfdrive/test/process_replay/test_fuzzy.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import copy
from hypothesis import given, HealthCheck, Phase, settings
import hypothesis.strategies as st

1
selfdrive/test/process_replay/test_imgproc.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import numpy as np
import hashlib

1
selfdrive/test/process_replay/test_processes.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import argparse
import concurrent.futures
import os

2
selfdrive/test/process_replay/test_regen.py Executable file → Normal file
View File

@ -1,5 +1,3 @@
#!/usr/bin/env python3
from parameterized import parameterized
from openpilot.selfdrive.test.process_replay.regen import regen_segment, DummyFrameReader

1
selfdrive/test/test_onroad.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import bz2
import math
import json

1
selfdrive/test/test_time_to_onroad.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import pytest
import time

1
selfdrive/test/test_updated.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import datetime
import os
import pytest

2
selfdrive/ui/tests/test_soundd.py Executable file → Normal file
View File

@ -1,5 +1,3 @@
#!/usr/bin/env python3
from cereal import car
from cereal import messaging
from cereal.messaging import SubMaster, PubMaster

1
selfdrive/ui/tests/test_translations.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import json
import os

1
system/athena/tests/test_athenad.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
from functools import wraps
import json

1
system/athena/tests/test_athenad_ping.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import subprocess
import threading

1
system/athena/tests/test_registration.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import json
from Crypto.PublicKey import RSA
from pathlib import Path

1
system/camerad/test/test_camerad.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import time
import numpy as np

1
system/camerad/test/test_exposure.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import time
import numpy as np

1
system/hardware/tici/tests/test_agnos_updater.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import json
import os
import requests

1
system/hardware/tici/tests/test_amplifier.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import time
import random

1
system/hardware/tici/tests/test_hardware.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import time
import numpy as np

1
system/hardware/tici/tests/test_power_draw.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
from collections import defaultdict, deque
import pytest
import time

1
system/loggerd/tests/test_deleter.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import time
import threading
from collections import namedtuple

1
system/loggerd/tests/test_encoder.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import math
import os
import pytest

1
system/loggerd/tests/test_loggerd.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import numpy as np
import os
import re

1
system/loggerd/tests/test_uploader.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import time
import threading

1
system/manager/test/test_manager.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import pytest
import signal

1
system/qcomgpsd/tests/test_qcomgpsd.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import pytest
import json

1
system/sensord/tests/test_sensord.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import pytest
import time

1
system/tests/test_logmessaged.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import glob
import os
import time

1
system/thermald/tests/test_fan_controller.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
from openpilot.system.thermald.fan_controller import TiciFanController

1
system/thermald/tests/test_power_monitoring.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
from openpilot.common.params import Params

1
system/ubloxd/tests/test_pigeond.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import time

1
system/updated/casync/tests/test_casync.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import os
import pathlib

1
system/webrtc/tests/test_stream_session.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import asyncio
import json
# for aiortc and its dependencies

1
system/webrtc/tests/test_webrtcd.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
import pytest
import asyncio
import json

View File

@ -1 +0,0 @@

1
tools/car_porting/test_car_model.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import argparse
import sys
import unittest # noqa: TID251

1
tools/lib/tests/test_caching.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import http.server
import os
import shutil

1
tools/lib/tests/test_logreader.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import capnp
import contextlib
import io

1
tools/lib/tests/test_readers.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
import pytest
import requests
import tempfile

1
tools/lib/tests/test_route_library.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
from collections import namedtuple
from openpilot.tools.lib.route import SegmentName

1
tools/plotjuggler/test_plotjuggler.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import os
import glob
import signal

1
tools/sim/tests/test_metadrive_bridge.py Executable file → Normal file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import pytest
import warnings