Expand ${ISOLATE_OUTDIR} in environment variables. |
||||
Issue descriptionEnvironment variables in swarming task requests may need to refer to the output directory, but this is only expanded in the command itself.
,
Oct 4
I am having trouble understanding how this would help our use case, does this mean that in order to set an environment variable that points to a location inside the output directory I would have to write a custom script that copies the contents of one variable to another and then calls the test command?
If so, this change would not be helpful, I could already write a script that takes '${ISOLATE_OUTDIR}' and the test command, exports the variable and calls the wrapped command. The whole point of this feature request is to be able to set this variable by only adding information to the swarming task request rather than modifying the payload.
,
Oct 4
+stgao
,
Oct 5
IMO, if we were to export ISOLATE_OUTDIR as an environment variable, Swarming's "runner" script could do that. However, we can't request all tests to understand this var name. It is still handy to support a template. What's the downside of expanding env vars? We already expand vars in command line already. Our use case for code coverage is to set following env. We can't expect Clang to understand ISOLATE_OUTDIR. CLANG_CODE_COVERAGE_DIR=$(ISOLATE_OUTDIR}/coverage On the other hand, we don't want to write a wrapper script to run all the tests in our CQ. If a wrapper script is the direction to go, I think Swarming should take care of this instead. Since this is a P0 blocker on our end, I'd assign to maruel@ for a decision.
,
Oct 5
A Google search for "CLANG_CODE_COVERAGE_DIR" leads to nothing. What is accepting this environment variable?
,
Oct 5
LLVM_PROFILE_FILE is the actual variable name
,
Oct 5
Thanks Roberto, if you think scaling this to python script (I'm thinking of test_env.py) would be too much work I'm fine with implementing this . https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#running-the-instrumented-program https://cs.chromium.org/chromium/src/testing/test_env.py
,
Oct 8
The following revision refers to this bug: https://chromium.googlesource.com/infra/luci/luci-py.git/+/656db1ac23505b56f46a64fbb1b2e82b76ce41c6 commit 656db1ac23505b56f46a64fbb1b2e82b76ce41c6 Author: Roberto Carrillo <robertocn@google.com> Date: Mon Oct 08 22:30:24 2018 [run_isolated] Replace parameters in environment variables. Environment variables specified in a swarming request may need to refer to the isolated out directory, just like parameters to the command do. This change applies to env variable values the same logic used to inject to the command the values of isolated out directory, executable extension, etc. Bug: 892348 Change-Id: I8507f0c96b723ae2eb32afef2a43e58e5bb5f509 R=maruel,vadimsh,stgao Reviewed-on: https://chromium-review.googlesource.com/c/1265140 Commit-Queue: Roberto Carrillo <robertocn@chromium.org> Reviewed-by: Vadim Shtayura <vadimsh@chromium.org> Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org> [modify] https://crrev.com/656db1ac23505b56f46a64fbb1b2e82b76ce41c6/appengine/swarming/doc/Magic-Values.md [modify] https://crrev.com/656db1ac23505b56f46a64fbb1b2e82b76ce41c6/client/run_isolated.py [modify] https://crrev.com/656db1ac23505b56f46a64fbb1b2e82b76ce41c6/client/tests/run_isolated_test.py
,
Oct 9
Fix is live. |
||||
►
Sign in to add a comment |
||||
Comment 1 by no...@chromium.org
, Oct 4Labels: -Type-Bug Type-Feature