From f2395c8d0535d025c4d1cd40f99a9198ad39ef3c Mon Sep 17 00:00:00 2001 From: nikita kozlovsky Date: Thu, 28 Dec 2023 11:34:47 +0100 Subject: [PATCH] ci: new config for ya tests muting (#601) * ci: new config for ya tests muting * mute test_postgres.py.TestPostgresSuite.test_postgres_suite* --- .github/actions/test_ya/action.yml | 3 +- .github/config/muted_ya.txt | 19 +++++++ .github/scripts/tests/transform-ya-junit.py | 58 ++++++++++----------- 3 files changed, 47 insertions(+), 33 deletions(-) create mode 100644 .github/config/muted_ya.txt diff --git a/.github/actions/test_ya/action.yml b/.github/actions/test_ya/action.yml index 377164e23d98..250fa7115a43 100644 --- a/.github/actions/test_ya/action.yml +++ b/.github/actions/test_ya/action.yml @@ -253,8 +253,7 @@ runs: shell: bash run: | .github/scripts/tests/transform-ya-junit.py -i \ - --mu .github/config/muted_test.txt \ - --mf .github/config/muted_functest.txt \ + -m .github/config/muted_ya.txt \ --ya-out "$OUT_DIR" \ --log-url-prefix "$S3_URL_PREFIX/logs/" \ --log-out-dir "$ARTIFACTS_DIR/logs/" \ diff --git a/.github/config/muted_ya.txt b/.github/config/muted_ya.txt new file mode 100644 index 000000000000..f6eabd2b53a4 --- /dev/null +++ b/.github/config/muted_ya.txt @@ -0,0 +1,19 @@ +ydb/core/blobstorage/pdisk/ut TSectorMap.* +ydb/core/blobstorage/ut_blobstorage Defragmentation.DoesItWork +ydb/core/blobstorage/ut_blobstorage SpaceCheckForDiskReassign.* +ydb/core/blobstorage/ut_blobstorage VDiskAssimilation.Test +ydb/core/blobstorage/ut_blobstorage [6/10]* +ydb/core/kqp/ut/federated_query/generic * +ydb/core/tx/columnshard/ut_schema TColumnShardTestSchema.ForgetAfterFail +ydb/core/tx/columnshard/ut_schema TColumnShardTestSchema.RebootForgetAfterFail +ydb/library/yql/sql/pg/ut PgSqlParsingAutoparam.AutoParamValues_DifferentTypes +ydb/services/ydb/sdk_sessions_pool_ut YdbSdkSessionsPool.StressTestSync10 +ydb/tests/fq/s3 * +ydb/tests/fq/yds test_metrics_cleanup.py.TestCleanup.test_cleanup[v1] +ydb/tests/functional/audit * +ydb/tests/functional/clickbench test.py.test_plans* +ydb/tests/functional/kqp/kqp_query_session KqpQuerySession.NoLocalAttach +ydb/tests/functional/postgresql test_postgres.py.TestPostgresSuite.test_postgres_suite* +ydb/tests/functional/tenants test_dynamic_tenants.py.* +ydb/tests/functional/tenants test_storage_config.py.TestStorageConfig.* +ydb/tests/functional/tenants test_tenants.py.* \ No newline at end of file diff --git a/.github/scripts/tests/transform-ya-junit.py b/.github/scripts/tests/transform-ya-junit.py index c3ae3e92274d..ef479fe66e19 100755 --- a/.github/scripts/tests/transform-ya-junit.py +++ b/.github/scripts/tests/transform-ya-junit.py @@ -17,34 +17,34 @@ def log_print(*args, **kwargs): class YaMuteCheck: def __init__(self): self.regexps = set() + self.regexps = [] - def add_unittest(self, fn): + def load(self, fn): with open(fn, "r") as fp: for line in fp: line = line.strip() - path, rest = line.split("/", maxsplit=1) - path = path.replace("-", "/") - rest = rest.replace("::", ".") - self.populate(f"{path}/{rest}") - - def add_functest(self, fn): - with open(fn, "r") as fp: - for line in fp: - line = line.strip() - line = line.replace("::", ".") - self.populate(line) - - def populate(self, line): - pattern = pattern_to_re(line) - - try: - self.regexps.add(re.compile(pattern)) - except re.error: - log_print(f"Unable to compile regex {pattern!r}") - - def __call__(self, suitename, testname): - for r in self.regexps: - if r.match(f"{suitename}/{testname}"): + try: + testsuite, testcase = line.split(" ", maxsplit=1) + except ValueError: + log_print(f"SKIP INVALID MUTE CONFIG LINE: {line!r}") + continue + self.populate(testsuite, testcase) + + def populate(self, testsuite, testcase): + check = [] + + for p in (pattern_to_re(testsuite), pattern_to_re(testcase)): + try: + check.append(re.compile(p)) + except re.error: + log_print(f"Unable to compile regex {p!r}") + return + + self.regexps.append(tuple(check)) + + def __call__(self, suite_name, test_name): + for ps, pt in self.regexps: + if ps.match(suite_name) and pt.match(test_name): return True return False @@ -176,8 +176,7 @@ def main(): parser.add_argument( "-i", action="store_true", dest="save_inplace", default=False, help="modify input file in-place" ) - parser.add_argument("--mu", help="unittest mute config") - parser.add_argument("--mf", help="functional test mute config") + parser.add_argument("-m", help="muted test list") parser.add_argument("--log-url-prefix", default="./", help="url prefix for logs") parser.add_argument("--log-out-dir", help="symlink logs to specific directory") parser.add_argument( @@ -194,11 +193,8 @@ def main(): mute_check = YaMuteCheck() - if args.mu: - mute_check.add_unittest(args.mu) - - if args.mf: - mute_check.add_functest(args.mf) + if args.m: + mute_check.load(args.m) transform( args.in_file,