aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2025-01-22 03:32:41 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2025-01-22 03:46:10 +0300
commit1fe77cc9a20285e75b6477e6744ad7612b9b090b (patch)
treed030e06e1c29013a739d09a7fafd8983709a9d15
parentfbaf25eeb4ece3eafbc5f111ff230d1124b86cab (diff)
downloadydb-1fe77cc9a20285e75b6477e6744ad7612b9b090b.tar.gz
Intermediate changes
commit_hash:5ea6ffd0d7d48367983624b2e3960a9a7e09927c
-rw-r--r--ya.conf2
-rwxr-xr-xyql/essentials/core/type_ann/type-ann-coverage.sh48
2 files changed, 50 insertions, 0 deletions
diff --git a/ya.conf b/ya.conf
index 12a4e4e11a..e1e3328444 100644
--- a/ya.conf
+++ b/ya.conf
@@ -27,9 +27,11 @@ OPENSOURCE = "yes"
USE_PREBUILT_TOOLS = "no"
APPLE_SDK_LOCAL = "yes"
USE_CLANG_CL = "yes"
+USE_OPENSOURCE_TEST_TOOL = "yes"
[flags]
OPENSOURCE = "yes"
USE_PREBUILT_TOOLS = "no"
APPLE_SDK_LOCAL = "yes"
USE_CLANG_CL = "yes"
+USE_OPENSOURCE_TEST_TOOL = "yes"
diff --git a/yql/essentials/core/type_ann/type-ann-coverage.sh b/yql/essentials/core/type_ann/type-ann-coverage.sh
new file mode 100755
index 0000000000..0858a7b4e4
--- /dev/null
+++ b/yql/essentials/core/type_ann/type-ann-coverage.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+#
+# Script to collect the type annotation callbacks, being uncovered
+# by minirun test suite. Pass the filename as the first argument
+# to store the collected list to the particular file.
+set -eu
+
+ARC_ROOT=$(arc rev-parse --show-toplevel)
+REPORT_ROOT=$(mktemp -p $TMPDIR -d yql-essentials-core-type_ann-coverage-XXXXXXX)
+# Save the list with uncovered callbacks into the file, that is
+# given by the first parameter of this script; otherwise, save
+# the list into the temporary file.
+UNCOVERED_FILE=${1:-$(mktemp -p $TMPDIR yql-essentials-core-type_ann-uncovered-XXXXXXX.list)}
+
+# Run the command to collect code coverage over the sources in
+# /yql/essentials/core/type_ann by the minirun test suite.
+# XXX: Here are the rationales for the particular options:
+# * --clang-coverage -- collect the code coverage only for C++
+# sources;
+# * --coverage-prefix-filter -- collect the code coverage only
+# for the dedicated source files;
+# * --coverage-report --output $REPORT_ROOT -- build the HTML
+# report for the collected code coverage;
+# See more info here: https://docs.yandex-team.ru/devtools/test/coverage.
+ya make -tA -C ${ARC_ROOT}/yql/essentials/tests/sql/minirun/ \
+ --build profile \
+ --clang-coverage \
+ --coverage-prefix-filter yql/essentials/core/type_ann \
+ --coverage-report \
+ --output $REPORT_ROOT \
+ --test-disable-timeout
+
+# Find an anchor to uncovered line in HTML report, ...
+UNCOVERED_ANCHOR="<td class='uncovered-line'><pre>0</pre></td>"
+# ... find the return type of the type annotation callback,
+# preceding the target function name ...
+# XXX: See more info re \K here: https://perldoc.perl.org/perlre#%5CK.
+CALLBACK_PREFIX="<td class='code'><pre>\s*IGraphTransformer::TStatus\s*\K"
+# ... and find the parameters types of the type annotation
+# callback, following the target function name.
+CALLBACK_SUFFIX="(?=\(const TExprNode::TPtr&amp; input, TExprNode::TPtr&amp; output, TContext&amp; ctx\))"
+grep -oP "$UNCOVERED_ANCHOR$CALLBACK_PREFIX(\w+)$CALLBACK_SUFFIX" \
+ -r $REPORT_ROOT/coverage.report/ \
+ --no-filename \
+ | tee -a $UNCOVERED_FILE
+
+rm -rf $REPORT_ROOT
+echo "The list of the uncovered functions: $UNCOVERED_FILE"