New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SUREFIRE-2025] Updated abstractions which helps associating systemProperties() with a test context #475
Conversation
void systemProperties( Map<String, String> sysProps ); | ||
void systemProperties( Map<String, String> sysProps, RunMode runMode, Long testRunId ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method name is not descriptive .... what does do .. read/write/verify properties?
Now new params - what for?
documentation is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tibor17 can you add some documentation for this method ... or you have such plan?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree and so I have added the Javadoc, pls see the commit 2840bfa.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The testRunId says - this is the test set.
The runMode says - normal mode, or re-run.
public void systemProperties( Map<String, String> sysProps ) | ||
public void systemProperties( Map<String, String> sysProps, RunMode rm, Long testRunId ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have field with the same name and type runMode
why not use filed from instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
field runMode
sometime is used ... sometime is overridden by method params in this class
line: 389, 419
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fields runMode
will be deleted in ForkinRunListener
and EventChannelEncoder
.
This PR has only prepared changes in one method signature. The implementation of this abstract method comes right after. This PR is only an intermediate step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'r right, the runMode
as a test status should not be in 3 classes. It should be only in one, e.g. in the:
JUnit4RunListener
which implements framework's listener org.junit.runner.notification.RunListener
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, so it is next issue to clean up it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly
target.systemProperties( report.getSystemProperties() ); | ||
target.systemProperties( report.getSystemProperties(), null, null ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this class we have filed runMode
- why not used here?
- why is not propagated to
target
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did split the entire work of SUREFIRE-1860 into 5 pieces.
The line you are asking for is in my IDEA:
target.systemProperties( report.getSystemProperties(), report.getRunMode(), report.getTestRunId() );
Both getters will come in the next PR right after, see SUREFIRE-2015
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target
is not JUnit's RunListener implementation.
Only the framework's listener may have this data runMode
and be "stateful".
The target
is a pure encoder, and so it should not have any notion about stateful data regarding test status. It should only receive data, encode it, and send it to a channel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what for EventChannelEncoder
has runMode
field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runMode
field will be removed in the next PR.
This PR only changed some method signatures in the same manner with the previous one.
After this the implementation would come in PR.
@slawekjaranowski
Due to the system properties are sent only when the test set has finished. Pls notice that the XML report contains these system properties from the end of test set. Therefore I made these consequent changes in the last commit c33024e. The method we spoke above is gone and the functionality is intrisic down in the encoder due to the |
7f6b017
to
c33024e
Compare
…operties() with a test context added Javadoc TestSetReportEntry already contains system properties and systemProperties() can be removed in MasterProcessChannelEncoder
c33024e
to
e5e57cf
Compare
Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
[SUREFIRE-XXX] - Fixes bug in ApproximateQuantiles
,where you replace
SUREFIRE-XXX
with the appropriate JIRA issue. Best practiceis to use the JIRA issue title in the pull request title and in the first line of the
commit message.
mvn clean install
to make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
mvn -Prun-its clean install
).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.