aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Kozlovskiy <nikitka@gmail.com>2023-05-17 16:11:20 +0000
committernkozlovskiy <nmk@ydb.tech>2023-05-17 19:11:20 +0300
commit9d71f1560dec58f4eb2b12bbc239933fb1ca44ba (patch)
tree57ed9af4d4d4d7f098a7876710967a87c28f8c04
parent656ed33a91c084e24f4d398c7f35fa9608e5c27c (diff)
downloadydb-9d71f1560dec58f4eb2b12bbc239933fb1ca44ba.tar.gz
better testmo tags
better testmo tags Pull Request resolved: #218
-rw-r--r--.github/actions/test/action.yml29
1 files changed, 27 insertions, 2 deletions
diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml
index 57e46eacdb..fbfa20c98e 100644
--- a/.github/actions/test/action.yml
+++ b/.github/actions/test/action.yml
@@ -51,14 +51,39 @@ runs:
id: th
if: inputs.testman_token
shell: bash
+ env:
+ PR_NUMBER: ${{ github.event.number }}
run: |
RUN_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
+ BRANCH_TAG="$GITHUB_REF_NAME"
+
+ case $GITHUB_EVENT_NAME in
+ workflow_dispatch)
+ TESTMO_RUN_NAME="${{ github.run_id }} manual"
+ EXTRA_TAG="manual"
+ ;;
+ pull_request | pull_request_target)
+ TESTMO_RUN_NAME="${{ github.run_id }} PR #${PR_NUMBER}"
+ EXTRA_TAG="pr"
+ BRANCH_TAG=""
+ ;;
+ schedule)
+ TESTMO_RUN_NAME="${{ github.run_id }} schedule"
+ EXTRA_TAG="schedule"
+ ;;
+ *)
+ TESTMO_RUN_NAME="${{ github.run_id }}"
+ EXTRA_TAG=""
+ ;;
+ esac
+
testmo automation:resources:add-link --name build --url $RUN_URL --resources testmo.json
testmo automation:resources:add-field --name git-sha --type string --value ${GITHUB_SHA:0:7} --resources testmo.json
- testmo automation:run:create --instance "$TESTMO_URL" --project-id ${{inputs.testman_project_id}} --name "${{ github.run_id }}" \
+ testmo automation:run:create --instance "$TESTMO_URL" --project-id ${{inputs.testman_project_id}} --name "$TESTMO_RUN_NAME" \
--source "${{inputs.log_suffix}}" --resources testmo.json \
- --tags "$GITHUB_REF_NAME" | \
+ --tags "$BRANCH_TAG" --tags "$EXTRA_TAG" | \
echo "runid=$(cat)" >> $GITHUB_OUTPUT
+
- name: Test
shell: bash
run: |