From db0147e7c1a0f8c16c76f8a2db67c7a7831418ce Mon Sep 17 00:00:00 2001 From: Patrick762 Date: Fri, 7 Feb 2025 14:30:42 +0100 Subject: [PATCH] added more requirements and dockerfile for tests --- .dockerignore | 3 +++ Dockerfile | 9 +++++++++ requirements.txt | 8 +++++++- test.sh | 4 ++-- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..665af6d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +*/__pycache__/ +*.pyc +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ee7c991 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3 + +COPY requirements.txt . +RUN pip install -r requirements.txt + +COPY tests ./tests +COPY custom_components ./custom_components + +RUN python3 -m unittest discover -s tests -p "*_test.py" diff --git a/requirements.txt b/requirements.txt index 76f0ada..22c6869 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,10 @@ homeassistant bleak_retry_connector pyserial bluetooth_auto_recovery -crcmod \ No newline at end of file +crcmod +typing +asyncio +logging +bleak +async_timeout +aiousbwatcher \ No newline at end of file diff --git a/test.sh b/test.sh index 90b73db..b6595eb 100755 --- a/test.sh +++ b/test.sh @@ -1,4 +1,4 @@ #!/bin/sh -# Execute unittests of python library -python3 -m unittest discover -s tests -p "*_test.py" +# Execute unittests of python library inside docker +sudo docker build --progress=plain -t bluetti-bt-tests .