-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: project re-struct phase1, use hatch as build tool (#310)
This is the phase1 project re-struct, including the following changes: 1. use hatch instead of setuptools for CI & package build, 2. use /src/ project layout. 3. split ota_proxy out of otaclient package. Other changes are related to the above changes, including: 1. fix up import paths accordingly.
- Loading branch information
1 parent
c789d7b
commit 96ec607
Showing
78 changed files
with
90 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,24 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
OTA_CLIENT_DIR="${OTACLIENT_DIR:-/ota-client}" | ||
TEST_ROOT=/test_root | ||
OTACLIENT_SRC=/otaclient_src | ||
OUTPUT_DIR="${OUTPUT_DIR:-/test_result}" | ||
CERTS_DIR="${CERTS_DIR:-/certs}" | ||
VENV="${OTA_CLIENT_DIR}/.venv" | ||
|
||
# copy the source code as source is read-only | ||
cp -R "${OTACLIENT_SRC}" "${TEST_ROOT}" | ||
|
||
# copy the certs generated in the docker image to otaclient dir | ||
echo "setup certificates for testing..." | ||
cd ${OTA_CLIENT_DIR} | ||
cd ${TEST_ROOT} | ||
mkdir -p ./certs | ||
cp -av ${CERTS_DIR}/root.pem ./certs/1.root.pem | ||
cp -av ${CERTS_DIR}/interm.pem ./certs/1.interm.pem | ||
|
||
source ${VENV}/bin/activate | ||
|
||
# setup dependencies unconditionally | ||
# NOTE: if we only do minor modified to the requirements.txt, | ||
# we don't have to rebuild the image, just call pip here | ||
APP_DEPENDENCIES="${OTA_CLIENT_DIR}/otaclient/requirements.txt" | ||
[ -f "$APP_DEPENDENCIES" ] && echo "setup app dependencies..." && \ | ||
python3 -m pip install --no-cache-dir -q -r $APP_DEPENDENCIES | ||
TESTS_DEPENDENCIES="${OTA_CLIENT_DIR}/tests/requirements.txt" | ||
[ -f "$TESTS_DEPENDENCIES" ] && echo "setup tests dependencies..." && \ | ||
python3 -m pip install --no-cache-dir -q -r $TESTS_DEPENDENCIES | ||
|
||
# exec the input params | ||
echo "execute test with coverage" | ||
cd ${OTA_CLIENT_DIR} | ||
coverage run -m pytest --junit-xml=${OUTPUT_DIR}/pytest.xml ${@:-} | ||
coverage xml -o ${OUTPUT_DIR}/coverage.xml | ||
cd ${TEST_ROOT} | ||
hatch env create dev | ||
hatch run dev:coverage run -m pytest --junit-xml=${OUTPUT_DIR}/pytest.xml ${@:-} | ||
hatch run dev:coverage xml -o ${OUTPUT_DIR}/coverage.xml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# generated version file by build | ||
_version.py | ||
_otaclient_version.py |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
96ec607
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report