You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the dataDir option is used to specify the path that the instruments and the measurements files are written to.
It would be beneficial to add an option in scoverage to include the dataDir in the classpath. This would provide more flexibility in systems that do not guarantee a local filesystem but a distributed one. For example, in #249, Pants compiles may happen in a remote machine. Classpaths are well-known and would provide a better and more stable future extensibility for the scalac-scoverage-plugin for generating reports in a distributed compilation.
The text was updated successfully, but these errors were encountered:
To expand on the purpose for this change: in a remote execution environment that uses the Bazel remoting API (so, Bazel, Pants, a few other soon most likely) each 1) compiler invoke, 2) test run, will happen in an anonymous working directory on an unknown machine.
In particular, this means that:
compiler invokes should not have configuration that tries to write to any global shared directories (as with how all compiler invokes with scoverage write to a global dataDir)
test runs should allow configuring where their coverage output is written to at runtime (rather than relying on something that was set at compile time, as scoverage does now with the dataDir).
This ticket proposes to fix both 1 and 2 by changing where the scoverage compiler plugin writes the xml it generates to be written in the compiler's output directory (ie, on the output classpath for the compiled sources). There is a convention of using subdirectories of the META-INF directory for this, meaning that the result in the output directory after compilation would be something like:
Then, you would need to change the runtime behaviour of scoverage to consume the XML from the classpath, and to write its outputs to one of:
an environment variable or jvm property specifying a path to write outputs to
a subdirectory of the current working directory if the env/property isn't set
These changes allow for remote execution, but they also allow for caching, as with sbt's hoarder plugin (which would currently break with scoverage, afaict).
sammy-1234
changed the title
Adding DataDir to classpath in Scoverage for Pants
Adding DataDir to classpath in Scoverage
Jun 27, 2019
Currently, the dataDir option is used to specify the path that the instruments and the measurements files are written to.
It would be beneficial to add an option in scoverage to include the dataDir in the classpath. This would provide more flexibility in systems that do not guarantee a local filesystem but a distributed one. For example, in #249, Pants compiles may happen in a remote machine. Classpaths are well-known and would provide a better and more stable future extensibility for the scalac-scoverage-plugin for generating reports in a distributed compilation.
The text was updated successfully, but these errors were encountered: