Anna Arhipova | b80f23b | 2022-10-05 21:45:35 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | . ${CUSTOM_REPO_VENV_PATH}/bin/activate |
| 4 | |
| 5 | set -x |
| 6 | set -e |
| 7 | |
| 8 | if [ -z "${DATE}" ]; then |
| 9 | d=$(date +%Y-%m-%d) |
| 10 | export DATE_REPORT="$(date +%Y-%m-%d)" |
| 11 | else |
| 12 | export DATE_REPORT=${DATE} |
| 13 | fi |
| 14 | |
| 15 | export TESTRAIL_URL="https://mirantis.testrail.com" |
| 16 | #export TESTRAIL_USER_EMAIL="drivetrain-eng@mirantis.com" |
| 17 | #export TESTRAIL_USER_KEY="" |
| 18 | export TESTRAIL_PROJECT='Mirantis Cloud Platform' |
| 19 | #export JIRA_USER="mcp-qa-bot@mirantis.com" |
| 20 | #echo $JIRA_PWD |
| 21 | ######### Run Report Generator ########## |
| 22 | |
| 23 | for day in $DATE_REPORT; do |
| 24 | |
| 25 | if [ -z "${PLAN_NAME}" ]; then |
| 26 | export TESTRAIL_PLAN="[2019.2.0-update]System-${REPOSITORY_SUITE}-"${day} |
| 27 | else |
| 28 | export TESTRAIL_PLAN=${PLAN_NAME} |
| 29 | echo ${PLAN_NAME} |
| 30 | fi |
| 31 | |
| 32 | . ${VENV_PATH}/bin/activate |
| 33 | |
| 34 | python tcp_tests/report.py create-report \ |
| 35 | --testrail-host "$TESTRAIL_URL" \ |
| 36 | --testrail-user "$TESTRAIL_USER_EMAIL" \ |
| 37 | --testrail-user-key "$TESTRAIL_USER_KEY" \ |
| 38 | --testrail-plan $TESTRAIL_PLAN \ |
| 39 | --testrail-project "$TESTRAIL_PROJECT" \ |
| 40 | --out-type html \ |
| 41 | --push-to-testrail \ |
| 42 | --sort-by fails \ |
| 43 | --jira-host https://mirantis.jira.com/ \ |
| 44 | --jira-user $JIRA_USER \ |
| 45 | --jira-password $JIRA_PWD > ${day}_system_bug_report_$(date +%Y%m%d%H%M%S).html && ret=0 || ret=1 |
| 46 | |
| 47 | echo "Report for ${TESTRAIL_PLAN} finished with ${ret}" |
| 48 | |
| 49 | #export TESTRAIL_PLAN="[MCP1.1]BVT-"${day} |
| 50 | |
| 51 | #python tcp-qa/tcp_tests/report.py create-report \ |
| 52 | # --testrail-host "$TESTRAIL_URL" \ |
| 53 | # --testrail-user "$TESTRAIL_USER_EMAIL" \ |
| 54 | # --testrail-user-key "$TESTRAIL_USER_KEY" \ |
| 55 | # --testrail-plan $TESTRAIL_PLAN \ |
| 56 | # --testrail-project "$TESTRAIL_PROJECT" \ |
| 57 | # --out-type html \ |
| 58 | # --push-to-testrail \ |
| 59 | # --sort-by fails \ |
| 60 | # --jira-host https://mirantis.jira.com/ \ |
| 61 | # --jira-user $JIRA_USER \ |
| 62 | # --jira-password $JIRA_PWD > ${day}_bvt_bug_report_$(date +%Y%m%d%H%M%S).html && ret=0 || ret=1 |
| 63 | |
| 64 | #echo "Report for ${TESTRAIL_PLAN} finished with ${ret}" |
| 65 | |
| 66 | done |