diff options
author | Alexander Smirnov <alexv-smirnov@yandex-team.ru> | 2023-05-31 19:05:05 +0200 |
---|---|---|
committer | Alexander Smirnov <alexv-smirnov@yandex-team.ru> | 2023-05-31 19:05:05 +0200 |
commit | 10ba5cc0c3d130ce4b33d307d265b937dd572c39 (patch) | |
tree | f5de7deac53b0989332e9e8571d75c8916239f3f /.github/actions/test_python/action.yml | |
parent | 1db08b73476ce8a181ff6163ec91305fe7a8cc56 (diff) | |
download | ydb-10ba5cc0c3d130ce4b33d307d265b937dd572c39.tar.gz |
bring workflows from main
Diffstat (limited to '.github/actions/test_python/action.yml')
-rw-r--r-- | .github/actions/test_python/action.yml | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/.github/actions/test_python/action.yml b/.github/actions/test_python/action.yml new file mode 100644 index 0000000000..f195e408f2 --- /dev/null +++ b/.github/actions/test_python/action.yml @@ -0,0 +1,62 @@ +name: test-python +description: Run functional Python tests +inputs: + log_suffix: + required: true + type: string + test_label_regexp: + required: false + type: string + aws_key_id: + required: true + type: string + aws_key_value: + required: true + type: string + aws_bucket: + required: true + type: string + aws_endpoint: + required: true + type: string + +runs: + using: "composite" + steps: + - name: Test + shell: bash + run: | + export source_root=$(pwd) + export build_root=$(pwd)/../build/ + mkdir -p ../artifacts + rm -rf ../artifacts/* + + echo "Stdout log (gzip archive): https://storage.yandexcloud.net/${{inputs.aws_bucket}}/${{ github.repository }}/${{github.workflow}}/${{ github.run_id }}/${{inputs.log_suffix}}-${{inputs.sanitizer}}-pytest-stdout.gz" >> $GITHUB_STEP_SUMMARY + cd ${source_root}/ydb/tests/functional/ + bad_suites=$(grep -Eo 'ignore=[a-zA-Z_-]*' pytest.ini | sed -e 's/ignore=//g') + suites="" + for suite in $(echo */ | sed -e 's/\///g'); do + if [[ $(echo "$bad_suites" | grep -F -e $suite -) == '' ]]; then + suites+=$suite + suites+=$'\n' + fi + done + if [[ "${{inputs.test_label_regexp}}" != '' ]]; then + suites="${{inputs.test_label_regexp}}" + fi + source ${source_root}/ydb/tests/oss/launch/prepare.sh + echo -n "$suites" | parallel -j32 "pytest -o junit_logging=log -o junit_log_passing_tests=False \ + -v --junit-xml=${source_root}/ydb/tests/functional/test-results/xml/{}/res.xml {}" | \ + sed -e 's/\x1b\[[0-9;]*m//g' | \ + tee >(gzip --stdout > ${source_root}/../artifacts/${{inputs.log_suffix}}-pytest-stdout.gz) | \ + tee -a $GITHUB_STEP_SUMMARY + - name: Upload S3 + uses: shallwefootball/s3-upload-action@master + if: always() + with: + aws_key_id: ${{inputs.aws_key_id}} + aws_secret_access_key: ${{inputs.aws_key_value}} + aws_bucket: ${{inputs.aws_bucket}} + source_dir: ../artifacts + destination_dir: '${{ github.repository }}/${{github.workflow}}/${{ github.run_id }}' + endpoint: ${{inputs.aws_endpoint}} |