From 16c36229225d84dd93cca528bda5a3194a890305 Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Fri, 22 Dec 2023 12:19:25 +0000 Subject: [PATCH] NBI Component: - Fixing GitLab CI/CD pipeline - Updated scripts to manually launch NBI tests --- scripts/run_tests_locally-nbi-all.sh | 5 ++++- src/nbi/.gitlab-ci.yml | 9 +++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/run_tests_locally-nbi-all.sh b/scripts/run_tests_locally-nbi-all.sh index 39930a677..ec2987d77 100755 --- a/scripts/run_tests_locally-nbi-all.sh +++ b/scripts/run_tests_locally-nbi-all.sh @@ -21,6 +21,9 @@ 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_ietf_l2vpn.py + coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - nbi/tests/test_ietf_l2vpn.py \ nbi/tests/test_ietf_network.py diff --git a/src/nbi/.gitlab-ci.yml b/src/nbi/.gitlab-ci.yml index 1cb086a6b..47bd5bcbc 100644 --- a/src/nbi/.gitlab-ci.yml +++ b/src/nbi/.gitlab-ci.yml @@ -66,11 +66,8 @@ unit_test nbi: - sleep 5 - docker ps -a - docker logs $IMAGE_NAME - - > - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO -o log_cli=true --verbose - $IMAGE_NAME/tests/test_ietf_l2vpn.py - $IMAGE_NAME/tests/test_ietf_network.py - --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage run --append -m pytest --log-level=INFO --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=INFO --verbose $IMAGE_NAME/tests/test_ietf_network.py --junitxml=/opt/results/${IMAGE_NAME}_report_ietf_network.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -91,7 +88,7 @@ unit_test nbi: artifacts: when: always reports: - junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report_*.xml ## Deployment of the service in Kubernetes Cluster #deploy nbi: -- GitLab