Skip to content

Commit

Permalink
ASC-978 Update "rpc-zigzag" Version
Browse files Browse the repository at this point in the history
Update the script to pin to the 1.0 series for "rpc-zigzag". Also, added a
variable for the "rpc-zigzag" PyPI package at the top so it can be easily
updated in the future without hunting around in the script.

The ZigZag config file is contained as a heredoc within the script which is
written out to disk at runtime.
  • Loading branch information
ryan-rs committed Feb 25, 2019
1 parent ebe446a commit a947894
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions gating/check/post_send_junit_to_qtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,37 @@ set -x
export QTEST_API_TOKEN=${RPC_ASC_QTEST_API_TOKEN}
VENV_NAME="venv-qtest"
VENV_PATH="${WORKSPACE}/${VENV_NAME}"
ZIGZAG_PYPI_PACKAGE="rpc-zigzag~=1.0"
ZIGZAG_CONFIG_FILE="asc_sys-tests_zigzag_config.json"

if [[ ${RE_JOB_ACTION} == "system_staging" ]]; then
PROJECT_ID="84820"
else
PROJECT_ID="76551"
fi

## ZigZag Config -------------------------------------------------------------
cat <<-EOF >$ZIGZAG_CONFIG_FILE
{
"zigzag": {
"test_cycle": "{{ RPC_PRODUCT_RELEASE }}",
"project_id": "$PROJECT_ID",
"module_hierarchy": [
"{{ JOB_NAME }}",
"{{ MOLECULE_TEST_REPO }}.{{ MOLECULE_SCENARIO_NAME }}",
"{{zz_testcase_class}}"
],
"path_to_test_exec_dir": "/molecule/{{ MOLECULE_SCENARIO_NAME }}",
"build_url": "{{ BUILD_URL }}",
"build_number": "{{ BUILD_NUMBER }}",
"test_repo_name": "{{ MOLECULE_TEST_REPO }}",
"test_branch": "{{ RE_JOB_BRANCH }}",
"test_fork": "rcbops",
"test_commit": "{{ MOLECULE_GIT_COMMIT }}"
}
}
EOF

## Functions -----------------------------------------------------------------

source $(dirname ${0})/../../scripts/functions.sh
Expand All @@ -31,7 +55,7 @@ source "${VENV_PATH}/bin/activate"
VENV_PIP="${VENV_PATH}/bin/pip"

# Install zigzag from PyPI
${VENV_PIP} install rpc-zigzag
${VENV_PIP} install "${ZIGZAG_PYPI_PACKAGE}"

# Search for xml files in RE_HOOK_RESULT_DIR
xml_files=()
Expand All @@ -44,7 +68,7 @@ echo "Attempting upload of ${#xml_files[@]} XML files"
printf '%s\n' "${xml_files[@]}"
for i in "${xml_files[@]}"; do
# Use <TOOL NAME> to process and upload to qtest
if zigzag $i ${PROJECT_ID}; then
if zigzag $ZIGZAG_CONFIG_FILE $i; then
echo "Upload Success: $i"
else
echo "Upload Failure: $i"
Expand Down

0 comments on commit a947894

Please sign in to comment.