[ 
https://issues.apache.org/jira/browse/CASSANDRA-16630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17454255#comment-17454255
 ] 

Ekaterina Dimitrova commented on CASSANDRA-16630:
-------------------------------------------------

Should we update still JUnit 4 to last version? if we keep on using it in time 
with old tests, I have to check the differences between the current version and 
the last one. 

 
{quote}As per my understanding these changes in the output format should affect 
nothing, but your expertise here would be very helpful.
{quote}
I am also not aware of any issues with that, let's see if [~mck]  has something 
in mind. 
{quote}The newer _ant-junitlauncher_ version does not have necessary filtering 
capabilities. I gave a try in writing this logic manually, but it seems to be 
clunky and not very accurate. I can invest more time, but I'm not sure that 
full traces is a problem since we do not expect many failed tests, so it won't 
pollute our logs.
{quote}
We all hope for not many failures :D
{quote}Please, review the above output diffs for the XML formatter and let me 
know if you believe any of the changes may affect current pipeline (I'd be very 
grateful if you could comment on every point). Even though I'm able to fix all 
diffs (some would be hard but doable) and keep exactly the same format as for 
JUnit 4, I do want to minimize customizations and stick to the default JUnit 5 
format where possible.
{quote}
Sounds reasonable but I want to spend a bit more time on those formatters 
before making any conclusions.
{quote}In the meantime I double checked the source of _cql-test_ and 
_cql-test-some_ targets. They were introduced as a part of CASSANDRA-7248. 
Looks like that was done just for convenience and it probably made sense then. 
Now these target do not seem to be useful, so I'm going to remove them.
{quote}
Sounds reasonable to me. 

 
{quote} Is there any particular reason why some tests require "perTest" mode? I 
believe it just helps to prevent any issues with shared state (configs, 
statics, system properties, etc).
{quote}
I think the same but I see perTest was introduced 10 years ago in 
CASSANDRA-1859,
 [~brandon.williams] was a reviewer, he has sharp memory, maybe he remembers 
something different? :)

 

> Migrate to JUnit5
> -----------------
>
>                 Key: CASSANDRA-16630
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16630
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Test/unit
>            Reporter: Aleksei Zotov
>            Assignee: Aleksei Zotov
>            Priority: Low
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> h3. Overview
> Currently C* uses JUnit4 (version 4.12) which is obsolete. There is a newer 
> version 4.13.2 which we could update to. However, JUnit4 is generally 
> considered to be outdated and it is reasonable to migrate to JUnit5.
> Despite of having a syntax sugar in JUnit5 (assertThrow, lamda's support, 
> ect), there are no blockers that push us to move from JUnit4. The main 
> motivation for this initiative is rule of thumb to use up-to-date versions of 
> the dependencies.
> Obviously this change is not backward compatible with the open PRs and 
> previous C* versions. Therefore, it will require an additional effort for 
> backporting the changes and updating PRs that have tests. However, I believe 
> it should not be a blocker for this initiative.
> h3. Scope (preliminary list)
> # change JUnit4 to JUnit5 dependencies and make necessary changes in ant 
> tasks (https://ant.apache.org/manual/Tasks/junitlauncher.html)
> # update syntax in all tests (imports, Before/After annotations, etc)
> # update parameterized tests
> # create a new version of {{OrderedJUnit4ClassRunner}} and update 
> corresponding tests
> # update tests that use {{BMUnitRunner}} (as per 
> https://developer.jboss.org/docs/DOC-52953 it supports JUnit5)
> # update tests with {{@Rule}}
> # update tests with expected exceptions
> # update {{JStackJUnitTask}}
> # update formatters
> # create a separate ticket to migrate to {{ant-junitlauncher-1.10.11}} (once 
> it is released) and simplify {{JStackJUnitTask}} after 
> https://github.com/apache/ant/pull/147
> h3. Order of operations
> In order to make the transition more smooth we want to use a phased approach:
> # migrate to JUnit5 with [Vintage 
> Engine|https://junit.org/junit5/docs/current/user-guide/#dependency-metadata-junit-vintage],
>  so all JUnit4 tests work as is
> # update tests in a few bunches (to not have a huge single PR with numerous 
> conflicts)
> # disable (remove dependency) Vintage Engine, so only JUnit5 tests work



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to