rules_apple icon indicating copy to clipboard operation
rules_apple copied to clipboard

test_env value truncated if has comma

Open HannahShiSFB opened this issue 1 year ago • 4 comments

The xctest runner uses comma as separator to parse test_env, however it's common that the environment variable value contains comma as well, here is an example in grpc:

--test_env=GRPC_EXPERIMENTS=event_engine_client,event_engine_listener \
--test_env=GRPC_TRACE=event_engine,api \

This works fine in Linux, but on ios the environment variables passed to the test become

GRPC_EXPERIMENTS=event_engine_client
GRPC_TRACE=event_engine
event_engine_listener=
api=

HannahShiSFB avatar Jul 02 '23 19:07 HannahShiSFB

@keith Looks like you have been contributing a lot on the xctest runner, will you be able help on this?

HannahShiSFB avatar Jul 15 '23 16:07 HannahShiSFB

Should this just be changed so that --test_env accumulates and takes whatever value it was provided literally?

i.e.

bazel build //Foo --test_env=FOO=bar,baz --test_env=OTHER=Something
FOO="bar,baz"
OTHER="Something"

luispadron avatar Jul 15 '23 17:07 luispadron

Yes. In my case, the expectation is:

GRPC_EXPERIMENTS="event_engine_client,event_engine_listener"
GRPC_TRACE="event_engine,api"

HannahShiSFB avatar Jul 15 '23 17:07 HannahShiSFB

yea sounds reasonable

keith avatar Jul 17 '23 19:07 keith