Commit Graph

54 Commits

Author SHA1 Message Date
Justin Newberry
b28343e276 Revert "Pytest: run tests in random order" (#30469)
Revert "Pytest: run tests in random order (#30134)"

This reverts commit bdc0624d0320e75b521a8edcf4aebacb6ab96a75.
old-commit-hash: ba3067a560
2023-11-15 10:41:11 -08:00
Justin Newberry
586fe682e4 Pytest: run tests in random order (#30134)
* enable random order

* logprint info

* revert that

* better logging

* go to dfu

* try to flash every panda if not up to date

* revert panda debugging
old-commit-hash: a5d99e0ebb
2023-11-15 10:16:51 -08:00
Justin Newberry
a0b0c1c4e7 CI: codecov for multiprocessing (#30432)
old-commit-hash: 2629417320
2023-11-10 10:02:05 -08:00
Justin Newberry
0a901ebe02 Revert "CI: codecov for multiprocessing" (#30431)
Revert "CI: codecov for multiprocessing (#30428)"

This reverts commit 3b07eefe35677ba9cd35680864b88d5eacd3a25e.
old-commit-hash: 863fdec50e
2023-11-09 15:52:28 -08:00
Justin Newberry
81e3076dc6 CI: codecov for multiprocessing (#30428)
* concurrencty codecov

* its a list

* retrigger ci

* increase delay
old-commit-hash: 1e91cf92a1
2023-11-09 15:19:10 -08:00
Dean Lee
3a637fe455 athenad: fix memory leak in _do_upload() (#30237)
* fix memory leak

* test: stash

* clean up

* clean up

* ruff

* rm

* add py memory profiler

* test compress and no compress

* proper test

* comment

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 61288dfe06
2023-10-29 07:08:28 -10:00
Adeeb Shihadeh
61eb6f4f66 finish hardware move to system/ (#30140)
* finish hardware move to system/

* fix release

* couple more
old-commit-hash: c347096c3e
2023-10-02 16:49:07 -07:00
Justin Newberry
759ab03b03 Ruff: disallow non-openpilot imports (#29841)
old-commit-hash: 110cfef1c2
2023-09-08 10:43:02 -07:00
Justin Newberry
c7029ea15a System: cleanup paths to use a common class (#29816)
* use OP prefix for logmessage

* cleanup paths too

* cleanup the paths too

* add hw.py to release

* fix those issues

* fix unittests

* fix unittests

* fix unittests

* do swaglog_ipc properly across all the files

* fix that

* fix swaglog in c++

* review suggestions
old-commit-hash: bfe990b112
2023-09-07 11:32:47 -07:00
Justin Newberry
839e72de70 CI: use pytest for unittesting (#29709)
* switch to pytest

* static analysis

* fix the helpers

* static analysis

* remove that

* more parallel test

* cleanup

* static analysis

* durations min and tolerance

* reduce those iterations

* sleep time could be decreased too

* in case it's negative

* try using caching

* remove parallelization for first PR

* PR Cleanup

* reduce diff

* fix that

* bump panda
old-commit-hash: ca435d3447
2023-09-04 11:54:35 -07:00
Adeeb Shihadeh
16ec56398c add openpilot prefix to imports (#29498)
* add openpilot prefix to imports

* more

* more

* fix docs

* fix linter

* bump submodules

* fix patched tests

* update dynamic imports

* debug

* Revert "debug"

This reverts commit db5e13b9911cc74438bee123bc3430da6c31b24b.

* fix pm test
old-commit-hash: a9626f95b6
2023-08-20 20:49:55 -07:00
Justin Newberry
3ee0786de3 CI: Pylint to ruff (#29294)
* pylint to riff

* pylint to riff

* pylint to riff

* revert more

* undo exclude removal

* exclude tinygrad

* set line length

* pylint exclusions to ruff

* same excludes as old linter

* fix tools QA

* remove unrequired check

* revert linting third_party

* ignore e402
old-commit-hash: 7fdd9fc37c
2023-08-09 13:26:54 -07:00
Justin Newberry
7b677910df Linter: Fix >160 line length test (#29287)
* test

* fix line length

* fix line length

* fix file size

* revert poetry

* cleanup for PR
old-commit-hash: cf64b27168
2023-08-08 17:13:35 -07:00
Shane Smiskol
8089a6e4f6 athenad test: use helper function (#29217)
old-commit-hash: b53bf00555
2023-08-03 11:54:12 +01:00
Cameron Clough
e65fb3123f athena: stricter socket timeout when onroad (#29017)
old-commit-hash: 4d10ba8af8
2023-07-24 17:43:30 +01:00
Cameron Clough
dcd74839f9 athenad: test connection timeout (#28864)
old-commit-hash: 915aec3f5c
2023-07-17 20:21:52 +01:00
Adeeb Shihadeh
ee363d69e3 fix a bunch of python warnings (#28576)
* fix a bunch of python warnings

* fix that
old-commit-hash: 111b4eee30
2023-06-16 13:22:30 -07:00
Cameron Clough
54afe04e2f athenad: add getGithubUsername method (#28025)
* athenad: add getGithubUsername method

* add test

* order
old-commit-hash: 09d25ad999
2023-04-26 20:42:43 -07:00
Cameron Clough
c5cbd60a34 athenad: more types (#25877)
* add typing hints

* missed these

* revert functional changes and changes to uploader

* remove

* try any

* add types to test code

* try dataclass instead

* mypy needs this

* comments

* remove Any type

* remove unused method

* cleanup

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: e1c739f709
2022-12-12 17:15:37 -08:00
Cameron Clough
d3dbd91280 athenad: small tests cleanup (#26037)
* test helpers

* create file helper

* clearer

* type

* fix default create path

* static methods
old-commit-hash: 9e2a1121ea
2022-10-17 12:55:40 -07:00
Cameron Clough
597b949813 networking: add unmetered cellular toggle (#25902)
* add metered toggle to UI

* add GsmMetered param

* add NMMetered constants

* change LTE connection settings: connection.metered

* change to GsmUnmetered override

* update translations

* debug ui

* remove comment

* Revert "debug ui"

This reverts commit 2ad9e65ea229b814782be9f30cc7664125d7e908.

* 'Force Unmetered Cellular' toggle

* update translations

* remove description

* update translations

* change unmetered to metered
old-commit-hash: f611960391
2022-10-01 14:47:06 -07:00
Adeeb Shihadeh
0325a33752 add pyside2 package (#25602)
old-commit-hash: c6b749fb96
2022-08-30 15:10:52 -07:00
Willem Melching
5c97a090b6 athena: skip duplicate upload requests (#25062)
* athena: skip duplicate upload requests

* cleanup

* keep simple

* just ignore
old-commit-hash: 7e187426c7
2022-07-07 18:00:07 +02:00
Adeeb Shihadeh
3c48bc47b7 Move a bunch of stuff to system/ part 3 (#24829)
* move swaglog.py

* timezoned

* logmessaged

* version.py

* fix linter
old-commit-hash: 0fce5d9045
2022-06-11 23:19:27 -07:00
Maykon Pacheco
fe24326066 test for the strip_bz2_extension method (#24826)
old-commit-hash: 1847a70a47
2022-06-11 11:08:24 -07:00
Willem Melching
be08693d5c delay bz2 compression from logging to uploading (#24392)
* remove log_name

* log without compression

* fix tests

* remove extension for bootlog

* another test fix

* uploader compresses

* also compress in athena

* only compress qlog

* more generic check in do_upload

* fix bootlog compression

* lower loggerd cpu usage

* dont link against bz2

* set core affinity to little cluster

* handle old files
old-commit-hash: 77a6f3d034
2022-05-03 14:09:17 +02:00
Robbe Derks
7ef4b9115f Param to allow upload over cellular (#23811)
* param to allow upload over cellular

* brackets to be consistent

* move outside loop

* fix tests

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 5f64f1c089
2022-02-21 12:17:47 +01:00
Willem Melching
8788555f10 athena: expire items after 31 days (#23751)
* athena: expire items after 31 days

* add test
old-commit-hash: f03549c276
2022-02-11 13:52:44 +01:00
Willem Melching
48a9bd55c6 athena: specify network type for file uploads (#23687)
* athena: specify network type for file uploads

* add comment

* catch abort transfer

* fix tests

* put athena upload args in dict

* fix defaults

Co-authored-by: Joost Wooning <jwooning@gmail.com>
old-commit-hash: e9153fdb4b
2022-02-09 17:28:49 +01:00
Ryan
d947f4ff5b athena: unsuccessful upload handler requests. (#23620)
* Retry unsuccessful upload handler requests.

* test both cases

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 1d4191956b
2022-01-26 15:23:59 +01:00
Joost Wooning
ce94c27569 athena: uploads, show which items fail on error (#23412)
* athena: uploads, show which items fail on error

* fix upload-id

* no more 404

* Update selfdrive/athena/athenad.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 3ffebf4df5
2022-01-05 18:18:11 +01:00
Joost Wooning
dd05972019 athena: methods for adding and cancelling multiple upload requests (#23366)
* multiple upload cancel

* multiple uploads athena method

* cleanup

* cleanup

* more cleanup

* isnt used

* fix test

* actually fix test
old-commit-hash: 47bb62b875
2022-01-04 17:01:33 +01:00
Ewout ter Hoeven
f206ebd054 Pyupgrade 3.6: Update syntax with Python 3.6+ features (#23305)
Updated Python code with Python 3.6+ features:
- utf-8 encoding is now the default (PEP 3120)
- Replace list comprehensions by Generator Expressions (PEP 289)
- Replace yield loop by yield from (PEP 380)
- Remove the (object) subclass when defining a class
- Replace the IOError alias by OSError (PEP 3151)
- Define sets with curly braces {} instead of set()
- Remove "r" parameter from open function, which is default

Co-Authored-By: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-Authored-By: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>

Co-authored-by: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-authored-by: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>
old-commit-hash: 332f568a82
2021-12-24 11:18:39 -08:00
Devin Leamy
20a2b9d0a2 athena: persist upload queue to disk (#22659)
* revert submodules

* lowercase

* addressed comments

* add test for cancelled uploads

* formatting

* catch all exceptions

* handle empty param

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 8cb83b29a6
2021-12-14 13:29:17 +01:00
Adeeb Shihadeh
4d43279023 registration: remove key generation (#23111)
* registration: remove key generation

* add test
old-commit-hash: 9ceb1a15eb
2021-12-03 22:58:34 -08:00
Willem Melching
e8b1e69ac1 remove broken athena test
old-commit-hash: 0e78502181
2021-11-11 17:32:26 +01:00
Devin Leamy
5b5269cb06 athena: Do not show canceled upload items in listUploadQueue (#22627)
* do not show canceled upload items in listUploadQueue

* return item._asdict()

* athena: updated test for listUploadQueue
old-commit-hash: 12165c8865
2021-10-20 16:16:05 +02:00
Adeeb Shihadeh
ad96d0d130 move athena tests to github actions (#22475)
* move athena tests to actions

* run

* fix timeout
old-commit-hash: de7a9e0116
2021-10-07 13:22:14 -07:00
Adeeb Shihadeh
e9cd2a5561 need a jwt for those tests
old-commit-hash: f7bd264db8
2021-08-19 15:48:26 -07:00
Adeeb Shihadeh
4da8cf4f31 athena: hardcode jwt for tests
old-commit-hash: 7e3d002066
2021-08-19 14:19:14 -07:00
Greg Hogan
6cbe7f0749 athena: change test tearDown to setUp (#21935)
old-commit-hash: 1d64c18e49
2021-08-14 22:27:22 -07:00
Greg Hogan
9357587ace athena: add prefix param to listDataDirectory (#21906)
* athena: add prefix param to listDataDirectory

* only traverse directories that match prefix

* tests
old-commit-hash: 2dff84121e
2021-08-13 12:14:20 +02:00
Willem Melching
dad760624a athena: return current upload status in listUploadQueue (#21903)
* return current upload item in listUploadQueue

* update progress on read

* move to file helpers

* use dict instead of global
old-commit-hash: 28823917ea
2021-08-13 11:51:08 +02:00
Willem Melching
dd824ffe34 athenad: retry failed and timed out uploads (#21745)
* retry failed uploads

* test cleanup

* update comment

* also catch SSL error

* use defaults

* sleep in chunks
old-commit-hash: d5b6746ac5
2021-07-29 11:13:59 +02:00
Greg Hogan
88f6e9e1d2 athenad: fix log sort (#21703)
* athenad: fix log sort

* add test for logs to send

* use temp dir for logs

* fix changing SWAGLOG_DIR

* better way to patch SWAGLOG_DIR

* fix grammar
old-commit-hash: 0964871239
2021-07-24 20:11:29 -07:00
Greg Hogan
a86a549b5d athena: version endpoint (#21045)
* athena: version endpoint

* get_version function

* more explicit version validation
old-commit-hash: ea0f7e2797
2021-05-26 18:33:27 -07:00
Adeeb Shihadeh
8002b848b6 offroad alert for unregistered devices (#20870)
* offroad alert for unregistered devices

* update tests

* add param

* fix stretch
old-commit-hash: b93ccc465d
2021-05-11 03:18:45 -07:00
Adeeb Shihadeh
c9d5447edd registration unit tests (#20792)
* start tests

* more test

* done
old-commit-hash: 5b764ab477
2021-05-01 17:16:58 -07:00
Greg Hogan
f0b9176bd7 logging cleanup (#20502)
* switch some uploader messages to debug log

* use allow_sleep

* log when not request or response

* test both with params and without params
old-commit-hash: 1e3f8b014e
2021-03-26 17:36:01 -07:00
Greg Hogan
183d9f98a1 log to file and send through athena (#20250)
* log to file and send through athena

* rename logging level

* pass thru log formatter

* logMessage is TEXT

* send queue always strings

* switch to xattr and lower priority queue

* enable cloud logging for devices

* time or size based log rotation

* basename -> dirname

* remove HARDWARE.get_cloudlog_enabled

* fix errors

* fix another exception

* xattrs need to be bytes

* sending works

* cleanup files at start

* add id and adjust formatting

* do not send active log file

* better names

* separate log formatters

* fix formatter super init

* fix log file order

* ensure file always has file formatter

* i see why there was no formatter

* apply same formatting to cpp log msgs

* apply same formatting to cpp log msgs

* update queue names in tests

* strip deprecated keys in STATUS_PACKET

* strip DEPRECATED from dict recursively

* athena log queue test

* instanceof instead of type

* isinstance instead of type

* use super

* remove logentries

* last_scan param unused

* comment about special log msg attr names

* add dict_helpers.py to release files

* use monotonic time and counter for log rotation

* update for adjusted log file naming

* use monotonic clock for tracking last log file scan
old-commit-hash: 3d48bd934d
2021-03-25 13:30:09 -07:00