aboutsummaryrefslogtreecommitdiffstats
path: root/.github/actions/test_ya/action.yml
diff options
context:
space:
mode:
authorMaxim Yurchuk <maxim-yurchuk@ydb.tech>2024-08-30 12:32:01 +0300
committerGitHub <noreply@github.com>2024-08-30 12:32:01 +0300
commit9445a62996f6ec536fea0927abe084c6092f1933 (patch)
tree6d49f4617e9035e8bd4c079619f0e6c7ac5a240a /.github/actions/test_ya/action.yml
parentdc4ea7fee4599eea5e01d5eebf6c3b85287b2dcf (diff)
downloadydb-9445a62996f6ec536fea0927abe084c6092f1933.tar.gz
Prepare for testmo retries (#8475)
Diffstat (limited to '.github/actions/test_ya/action.yml')
-rw-r--r--.github/actions/test_ya/action.yml52
1 files changed, 30 insertions, 22 deletions
diff --git a/.github/actions/test_ya/action.yml b/.github/actions/test_ya/action.yml
index 0df3f2b31c..3af76b2fbe 100644
--- a/.github/actions/test_ya/action.yml
+++ b/.github/actions/test_ya/action.yml
@@ -83,12 +83,34 @@ runs:
mkdir -p $PUBLIC_DIR
echo "LAST_JUNIT_REPORT_XML=$PUBLIC_DIR/last_junit.xml" >> $GITHUB_ENV
- echo "TESTMO_URL=${{ inputs.testman_url }}" >> $GITHUB_ENV
+ export TESTMO_URL=${{ inputs.testman_url }}
+ echo "TESTMO_URL=$TESTMO_URL" >> $GITHUB_ENV
echo "SUMMARY_LINKS=$PUBLIC_DIR/summary_links.txt" >> $GITHUB_ENV
echo "BUILD_PRESET=${{ inputs.build_preset }}" >> $GITHUB_ENV
python3 -m pip install ydb ydb[yc] codeowners
+ if [ ${{ inputs.testman_token }} ]; then
+ TESTMO_PROXY_ADDR=127.0.0.1:8888
+ openssl req -x509 -newkey rsa:2048 \
+ -keyout $TMP_DIR/key.pem -out $TMP_DIR/cert.pem \
+ -sha256 -days 1 -nodes -subj "/CN=127.0.0.1"
+
+ TESTMO_TOKEN=${{ inputs.testman_token }} ./ydb/ci/testmo-proxy/testmo-proxy.py -l $TESTMO_PROXY_ADDR \
+ --cert-file "$TMP_DIR/cert.pem" \
+ --cert-key "$TMP_DIR/key.pem" \
+ --target-timeout 3,60 \
+ --max-request-time 200 \
+ "$TESTMO_URL" > $PUBLIC_DIR/testmo_proxy.log 2>&1 &
+
+ TESTMO_PROXY_PID=$!
+ echo "TESTMO_PROXY_ADDR=$TESTMO_PROXY_ADDR" >> $GITHUB_ENV
+ echo "TESTMO_PROXY_PID=$TESTMO_PROXY_PID" >> $GITHUB_ENV
+
+ # testmo rejects self-signed cert without this setting
+ echo "NODE_TLS_REJECT_UNAUTHORIZED=0" >> $GITHUB_ENV
+ fi
+
- name: ya build and test
id: build
shell: bash
@@ -260,7 +282,7 @@ runs:
TESTMO_TOKEN=${{ inputs.testman_token }} testmo automation:resources:add-link --name build --url "$TESTMO_RUN_URL" --resources testmo.json
TESTMO_TOKEN=${{ inputs.testman_token }} testmo automation:resources:add-field --name git-sha --type string --value "${GITHUB_SHA:0:7}" --resources testmo.json
TESTMO_RUN_ID=$(
- TESTMO_TOKEN=${{ inputs.testman_token }} testmo automation:run:create --instance "$TESTMO_URL" --project-id ${{ inputs.testman_project_id }} \
+ TESTMO_TOKEN=${{ inputs.testman_token }} testmo automation:run:create --instance "https://$TESTMO_PROXY_ADDR" --project-id ${{ inputs.testman_project_id }} \
--name "$TESTMO_RUN_NAME" --source "$TESTMO_SOURCE" --resources testmo.json \
--tags "$TESTMO_BRANCH_TAG" --tags "$TESTMO_EXTRA_TAG"
)
@@ -373,29 +395,12 @@ runs:
.github/scripts/tests/split-junit.py -o "$TESTMO_JUNIT_REPORT_PARTS" "$CURRENT_JUNIT_XML_PATH"
# archive unitest reports (transformed)
tar -C $TESTMO_JUNIT_REPORT_PARTS/.. -czf $PUBLIC_DIR/junit_parts.xml.tar.gz $(basename $TESTMO_JUNIT_REPORT_PARTS)
-
- TESTMO_PROXY_ADDR=127.0.0.1:8888
-
- openssl req -x509 -newkey rsa:2048 \
- -keyout $TMP_DIR/key.pem -out $TMP_DIR/cert.pem \
- -sha256 -days 1 -nodes -subj "/CN=127.0.0.1"
-
- TESTMO_TOKEN=${{ inputs.testman_token }} ./ydb/ci/testmo-proxy/testmo-proxy.py -l $TESTMO_PROXY_ADDR \
- --cert-file "$TMP_DIR/cert.pem" \
- --cert-key "$TMP_DIR/key.pem" \
- --target-timeout 3,10 \
- --max-request-time 55 \
- "$TESTMO_URL" &
-
- testmo_proxy_pid=$!
- TESTMO_TOKEN=${{ inputs.testman_token }} NODE_TLS_REJECT_UNAUTHORIZED=0 testmo automation:run:submit-thread \
+ TESTMO_TOKEN=${{ inputs.testman_token }} testmo automation:run:submit-thread \
--instance "https://$TESTMO_PROXY_ADDR" --run-id "$TESTMO_RUN_ID" \
--results "$TESTMO_JUNIT_REPORT_PARTS/*.xml"
-
- kill $testmo_proxy_pid
- TESTMO_TOKEN=${{ inputs.testman_token }} testmo automation:run:complete --instance "$TESTMO_URL" --run-id $TESTMO_RUN_ID
+ TESTMO_TOKEN=${{ inputs.testman_token }} testmo automation:run:complete --instance "https://$TESTMO_PROXY_ADDR" --run-id $TESTMO_RUN_ID || true
echo "runid=" >> $GITHUB_OUTPUT
fi
@@ -435,7 +440,10 @@ runs:
shell: bash
run: |
if [ ${{ steps.build.outputs.runid }} ]; then
- TESTMO_TOKEN=${{ inputs.testman_token }} testmo automation:run:complete --instance "$TESTMO_URL" --run-id ${{ steps.build.outputs.runid }}
+ TESTMO_TOKEN=${{ inputs.testman_token }} testmo automation:run:complete --instance "https://$TESTMO_PROXY_ADDR" --run-id ${{ steps.build.outputs.runid }} || true
+ fi
+ if [ ${{ inputs.testman_token }} ]; then
+ kill $TESTMO_PROXY_PID
fi
- name: analyze tests results
shell: bash