Skip to content

Commit

Permalink
ci: new config for ya tests muting (ydb-platform#601)
Browse files Browse the repository at this point in the history
* ci: new config for ya tests muting
* mute test_postgres.py.TestPostgresSuite.test_postgres_suite*
  • Loading branch information
nikitka authored Dec 28, 2023
1 parent 70cada1 commit f2395c8
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 33 deletions.
3 changes: 1 addition & 2 deletions .github/actions/test_ya/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/" \
Expand Down
19 changes: 19 additions & 0 deletions .github/config/muted_ya.txt
Original file line number Diff line number Diff line change
@@ -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.*
58 changes: 27 additions & 31 deletions .github/scripts/tests/transform-ya-junit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand Down

0 comments on commit f2395c8

Please sign in to comment.