apache / apache/maven-surefire

[SUREFIRE-2078] systemPropertyVariables not working

Open
#3,146 2 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
461
Forks
588
Avg merge
1d 8h
Merged PRs (30d)
19

Description

**[Delany](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=delany)** opened **[SUREFIRE-2078](https://issues.apache.org/jira/browse/SUREFIRE-2078?redirect=false)** and commented

Hi. Im trying to use the opentelemetry java agent, but either surefire is not passing through the parameters, or the agent is not picking them up.

It works if I pass via the {**}argLine{**}, but not via **systemPropertyVariables** or {**}systemProperties{**}.

https://maven.apache.org/surefire/maven-surefire-plugin/examples/system-properties.html

https://opentelemetry.io/docs/instrumentation/java/automatic/agent-config/

Here is my up-to-date reproducer

https://github.com/delanym/java-maven-junit-helloworld/tree/opentelemetry

Run `mvn test` and you should get a line on the console like

```
[otel.javaagent 2022-04-26 10:33:44:015 +0200] [main] INFO io.opentelemetry.exporter.logging.LoggingSpanExporter - 'HelloTest.testSayHelloAFewTimes' : be46c05e6d80182590d5289426358fb7 e4c666619bfc7c2d INTERNAL [tracer: io.opentelemetry.opentelemetry-anno
tations-1.0:1.13.0-alpha] AttributesMap{data={thread.id=1, thread.name=main}, capacity=128, totalAddedValues=2}
```

Try to use the systemPropertyVariables instead and it will not show.

---

**Affects:** 3.0.0-M6

Contributor guide

Open the contributing guide

Research direction

Start with the linked java-maven-junit-helloworld reproducer and run `mvn test` using `argLine`, then repeat with `systemPropertyVariables` or `systemProperties`. Compare the agent output in each case and trace how Surefire passes these settings; done means the system-property configuration produces the same expected OpenTelemetry output.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.