Skip to content
Snippets Groups Projects
Commit 26687a9b authored by Grégoire Kubler's avatar Grégoire Kubler
Browse files

feat : refactored unit tests to be more comprehensible

parent e3745d3e
No related branches found
No related tags found
1 merge request!8multiple fixes
......@@ -16,7 +16,6 @@ release:pip:ubuntu:
- apt-get install -y -qq python-is-python3 pip git curl
script:
- ls venv/bin/activate
- source venv/bin/activate
- set -x
- python -m pip wheel . -w wheelhouse
......@@ -29,22 +28,15 @@ release:pip:ubuntu:
python3 -m pip install requests
fi
- echo "Uninstalling $CI_PROJECT_NAME to install the wheel created"
- export WHEEL_NAME=$(find wheelhouse/ -name "$CI_PROJECT_NAME*.whl")
- echo "Wheel name = ${WHEEL_NAME}"
- python -m pip uninstall -y $CI_PROJECT_NAME
- python -m pip install $WHEEL_NAME
- python -m pip list
###############################################################################
# Repo name is changed the repo name with mv in order to perform the test
# on the installed package and not on the source code
# https://stackoverflow.com/questions/56908227/how-to-test-python-wheels-on-ci
###############################################################################
- echo "Current working directory = $(pwd)"
- rm -rf temp_src
- mv $CI_PROJECT_NAME temp_src
- python -m pytest temp_src/unit_tests/
- mv temp_src $CI_PROJECT_NAME
- export WHEELS=$(find wheelhouse/ -name "$CI_PROJECT_NAME*.whl")
- echo "Reinstalling each found wheels = ${WHEELS}"
- >
for wheel in $WHEELS; do # not sure if a for loop is needed here but just in case multiple wheels are found
python -m pip install --force-reinstall $WHEEL_NAME
python -m pip list
cd $CI_PROJECT_NAME # entering package so python doesn't import local package and in
python -m pytest unit_tests/*
done
deploy:pip:ubuntu:
extends:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment