diff options
author | nkozlovskiy <nmk@ydb.tech> | 2023-07-25 17:41:25 +0300 |
---|---|---|
committer | root <root@qavm-2ed34686.qemu> | 2023-07-25 17:41:25 +0300 |
commit | 788066e20f590877ad5bc1dd8176a7d0b688f260 (patch) | |
tree | d912490b80b285f075c2d508776871d99082df0c | |
parent | 4b24a7df4a2e15ae87c76489938287018ad62fda (diff) | |
download | ydb-788066e20f590877ad5bc1dd8176a7d0b688f260.tar.gz |
ci: mute functional tests
ci: mute functional tests
Pull Request resolved: #310
-rw-r--r-- | .github/actions/test/action.yml | 14 | ||||
-rw-r--r-- | .github/config/muted_functest.txt | 2 | ||||
-rwxr-xr-x | .github/scripts/tests/ctest-postprocess.py | 2 | ||||
-rwxr-xr-x | .github/scripts/tests/junit-postprocess.py | 27 | ||||
-rw-r--r-- | .github/scripts/tests/mute_utils.py | 11 |
5 files changed, 42 insertions, 14 deletions
diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index a84ea35208c..52115cc07cd 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -53,6 +53,7 @@ runs: echo "logfilename=${{inputs.log_suffix}}-ctest-stdout.gz" >> $GITHUB_OUTPUT echo "testfilterfile=$(pwd)/.github/config/muted_test.txt" >> $GITHUB_OUTPUT echo "testshardfilterfile=$(pwd)/.github/config/muted_shard.txt" >> $GITHUB_OUTPUT + echo "functestfilterfile=$(pwd)/.github/config/muted_functest.txt" >> $GITHUB_OUTPUT echo "logurlprefix=${{inputs.aws_endpoint}}/${{inputs.aws_bucket}}/${{ github.repository }}/${{github.workflow}}/${{github.run_id}}" >> $GITHUB_OUTPUT echo "pytest-logfilename=${{inputs.log_suffix}}-pytest-stdout.gz" >> $GITHUB_OUTPUT @@ -252,6 +253,19 @@ runs: grep -E '(FAILED|ERROR)\s*\[.*\]' | \ tee $WORKDIR/pytest-short.log + - name: postprocess functional test reports + if: always() && inputs.run_functional_tests == 'true' + shell: bash + run: | + echo "::group::junit-postprocess" + + .github/scripts/tests/junit-postprocess.py \ + --filter-file ${{ steps.init.outputs.functestfilterfile }} \ + $PYTESTREPDIR/ + + echo "::endgroup::" + + - name: write functional tests summary if: always() && inputs.run_functional_tests == 'true' shell: bash diff --git a/.github/config/muted_functest.txt b/.github/config/muted_functest.txt new file mode 100644 index 00000000000..3439497e991 --- /dev/null +++ b/.github/config/muted_functest.txt @@ -0,0 +1,2 @@ +open_source.test_yatest_common.TestYaTestContext::test_source_path +::suite_tests.test_postgres diff --git a/.github/scripts/tests/ctest-postprocess.py b/.github/scripts/tests/ctest-postprocess.py index 1abe43a7dbe..10eacf67673 100755 --- a/.github/scripts/tests/ctest-postprocess.py +++ b/.github/scripts/tests/ctest-postprocess.py @@ -32,7 +32,7 @@ def postprocess_ctest(log_fp: TextIO, ctest_junit_report, is_mute_shard, dry_run remove_failure(testcase) if n_remove_failures: - update_suite_info(root, n_remove_failures, n_skipped) + update_suite_info(root, n_remove_failures, n_skipped=n_skipped) print(f"{'(dry-run) ' if dry_run else ''}update {ctest_junit_report}") if not dry_run: tree.write(ctest_junit_report, xml_declaration=True, encoding="UTF-8") diff --git a/.github/scripts/tests/junit-postprocess.py b/.github/scripts/tests/junit-postprocess.py index 3c4fdb05cc4..4839477eff6 100755 --- a/.github/scripts/tests/junit-postprocess.py +++ b/.github/scripts/tests/junit-postprocess.py @@ -22,9 +22,10 @@ def postprocess_junit(is_mute_test, folder, dry_run): for fn in glob.glob(os.path.join(folder, "*.xml")): tree = ET.parse(fn) root = tree.getroot() - total_muted = 0 + total_err = total_fail = 0 + for suite in root.findall("testsuite"): - muted_cnt = 0 + fail_cnt = error_cnt = 0 for case, cls, method in case_iterator(suite): attach_filename(case, os.path.basename(fn)) @@ -32,14 +33,20 @@ def postprocess_junit(is_mute_test, folder, dry_run): if is_mute_test(cls, method): if mute_target(case): print(f"mute {cls}::{method}") - muted_cnt += 1 - - if muted_cnt: - update_suite_info(suite, n_skipped=muted_cnt, n_remove_failures=muted_cnt) - total_muted += muted_cnt - - if total_muted: - update_suite_info(root, n_skipped=total_muted, n_remove_failures=total_muted) + fail_cnt += 1 + elif mute_target(case, "error"): + print(f"mute error {cls}::{method}") + error_cnt += 1 + + if fail_cnt or error_cnt: + update_suite_info(suite, n_remove_failures=fail_cnt, n_remove_errors=error_cnt, + n_skipped=fail_cnt + error_cnt) + total_err += error_cnt + total_fail += fail_cnt + + if total_fail or total_err: + update_suite_info(root, n_remove_errors=total_err, n_remove_failures=total_fail, + n_skipped=total_err + total_fail) print(f"{'(dry-run) ' if dry_run else ''}patch {fn}") diff --git a/.github/scripts/tests/mute_utils.py b/.github/scripts/tests/mute_utils.py index 21dab3bf46e..0d1af5a2f85 100644 --- a/.github/scripts/tests/mute_utils.py +++ b/.github/scripts/tests/mute_utils.py @@ -54,13 +54,15 @@ class MutedShardCheck: return target in self.muted -def mute_target(node): - failure = node.find("failure") +def mute_target(node, node_name="failure"): + failure = node.find(node_name) if failure is None: return False skipped = ET.Element("skipped", {"message": failure.attrib["message"]}) + skipped.text = failure.text + node.remove(failure) node.append(skipped) @@ -92,10 +94,13 @@ def dec_attr(node, attr, value): return op_attr(node, attr, operator.sub, value) -def update_suite_info(root, n_remove_failures=None, n_skipped=None): +def update_suite_info(root, n_remove_failures=None, n_remove_errors=None, n_skipped=None): if n_remove_failures: dec_attr(root, "failures", n_remove_failures) + if n_remove_errors: + dec_attr(root, "errors", n_remove_errors) + if n_skipped: inc_attr(root, "skipped", n_skipped) |