Commit f4e6ea6d authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

NBI component:

- Reorganized test bash and python scripts
- Updated CI/CD unit test
parent 27b4a679
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -13,7 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

export FLASK_ENV=development

# Add live logs with: -o log_cli=true
python -m pytest --log-level=DEBUG --verbose nbi/tests/test_nbi.py
PROJECTDIR=`pwd`

cd $PROJECTDIR/src
RCFILE=$PROJECTDIR/coverage/.coveragerc

# Run unitary tests and analyze coverage of code at same time
# helpful pytest flags: --log-level=INFO -o log_cli=true --verbose --maxfail=1 --durations=0
coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
    nbi/tests/test_core.py
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ unit_test nbi:
    - sleep 5
    - docker ps -a
    - docker logs $IMAGE_NAME
    - docker exec -i $IMAGE_NAME bash -c "coverage run --append -m pytest --log-level=DEBUG -o log_cli=true --verbose $IMAGE_NAME/tests/test__nbi_core.py --junitxml=/opt/results/${IMAGE_NAME}_report_nbi_core.xml"
    - docker exec -i $IMAGE_NAME bash -c "coverage run --append -m pytest --log-level=DEBUG -o log_cli=true --verbose $IMAGE_NAME/tests/test_core.py --junitxml=/opt/results/${IMAGE_NAME}_report_core.xml"
    - docker exec -i $IMAGE_NAME bash -c "coverage run --append -m pytest --log-level=DEBUG -o log_cli=true --verbose $IMAGE_NAME/tests/test_tfs_api.py --junitxml=/opt/results/${IMAGE_NAME}_report_tfs_api.xml"
    - docker exec -i $IMAGE_NAME bash -c "coverage run --append -m pytest --log-level=DEBUG -o log_cli=true --verbose $IMAGE_NAME/tests/test_ietf_l2vpn.py --junitxml=/opt/results/${IMAGE_NAME}_report_ietf_l2vpn.xml"
    - docker exec -i $IMAGE_NAME bash -c "coverage run --append -m pytest --log-level=DEBUG -o log_cli=true --verbose $IMAGE_NAME/tests/test_ietf_network.py --junitxml=/opt/results/${IMAGE_NAME}_report_ietf_network.xml"