My Pytest run created a HTML report on the folder and I was copying it from that folder to the build folder and the log shows the artifactory is uploaded successfully however the downloaded folder is empty and has no report in it.
Logs output:
-------------- generated html file: /apps-test/report/report.html --------------
===================== 2 failed, 23 passed in 3.51 seconds ======================
[2054]Uploading artifacts for failed job00:10
[2055]Uploading artifacts…
[2056]logs/: found 1 matching files and directories
[2057]Uploading artifacts as “archive” to coordinator… ok id=2135480 responseStatus=201 Created token=iVbG4yGc
[2059]Cleaning up file based variables
gitlab ci/cd yaml:
variables:
TESTS_TORUN: /apps-test/tests/$CLASS_NAME
REPORT_PATH: /apps-test/report/
CONTAINER_IMAGE: $REGISTRY_HOST/$CONTAINER_FOLDER/$IMAGE_NAME
before_script:
- echo TESTS_TORUN
- docker rm -f $CONTAINER_NAME
- docker pull $CONTAINER_IMAGE:latest
script:
- mkdir ${CI_PROJECT_DIR}/logs
- docker run -m 2G --memory-swap 2G --env env=$ENV -d -w /apps-test -v mount_home --name=$CONTAINER_NAME $CONTAINER_IMAGE tail -f /bin/sh
- docker exec $CONTAINER_NAME pytest -q $TESTS_TORUN --html=$REPORT_PATH/report.html | tee -a jobfile.log
- docker cp $CONTAINER_NAME:$REPORT_PATH/report.html $CONTAINER_NAME${CI_PROJECT_DIR}/logs
artifacts:
expire_in: 1 week
when: always
paths:
- logs/