Skip to content

Commit cb9dc8a

Browse files
jnthntatumcopybara-github
authored andcommitted
Fix command line argument splitting issue for conformance tests.
PiperOrigin-RevId: 912731724
1 parent 5806d30 commit cb9dc8a

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

conformance/run.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _conformance_test_name(name, optimize, recursive):
5656
],
5757
)
5858

59-
def _conformance_test_args(modern, optimize, recursive, select_opt, skip_check, skip_tests, dashboard):
59+
def _conformance_test_args(modern, optimize, recursive, select_opt, skip_check, dashboard):
6060
args = []
6161
if modern:
6262
args.append("--modern")
@@ -70,18 +70,18 @@ def _conformance_test_args(modern, optimize, recursive, select_opt, skip_check,
7070
args.append("--skip_check")
7171
else:
7272
args.append("--noskip_check")
73-
args.append("--skip_tests=\"{}\"".format(",".join(_expand_tests_to_skip(skip_tests))))
7473
if dashboard:
7574
args.append("--dashboard")
7675
return args
7776

7877
def _conformance_test(name, data, modern, optimize, recursive, select_opt, skip_check, skip_tests, tags, dashboard):
7978
cc_test(
8079
name = _conformance_test_name(name, optimize, recursive),
81-
args = _conformance_test_args(modern, optimize, recursive, select_opt, skip_check, skip_tests, dashboard) + ["$(location " + test + ")" for test in data] + select(
80+
args = _conformance_test_args(modern, optimize, recursive, select_opt, skip_check, dashboard) + ["$(location " + test + ")" for test in data],
81+
env = select(
8282
{
83-
"@platforms//os:windows": ["--skip_tests=\"{}\"".format(",".join(skip_tests + _TESTS_TO_SKIP_WINDOWS))],
84-
"//conditions:default": ["--skip_tests=\"{}\"".format(",".join(skip_tests))],
83+
"@platforms//os:windows": {"CEL_SKIP_TESTS": ",".join(skip_tests + _TESTS_TO_SKIP_WINDOWS)},
84+
"//conditions:default": {"CEL_SKIP_TESTS": ",".join(skip_tests)},
8585
},
8686
),
8787
data = data,

conformance/run.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "absl/strings/cord.h"
4343
#include "absl/strings/match.h"
4444
#include "absl/strings/str_cat.h"
45+
#include "absl/strings/str_split.h"
4546
#include "absl/strings/string_view.h"
4647
#include "absl/strings/strip.h"
4748
#include "absl/types/span.h"
@@ -273,6 +274,13 @@ int main(int argc, char** argv) {
273274
{
274275
auto service = NewConformanceServiceFromFlags();
275276
auto tests_to_skip = absl::GetFlag(FLAGS_skip_tests);
277+
if (const char* env_skip = std::getenv("CEL_SKIP_TESTS");
278+
env_skip != nullptr) {
279+
for (absl::string_view test :
280+
absl::StrSplit(env_skip, ',', absl::SkipEmpty())) {
281+
tests_to_skip.push_back(std::string(test));
282+
}
283+
}
276284
for (int argi = 1; argi < argc; argi++) {
277285
ABSL_CHECK_OK(RegisterTestsFromFile(service, tests_to_skip,
278286
absl::string_view(argv[argi])));

0 commit comments

Comments
 (0)