jetcd icon indicating copy to clipboard operation
jetcd copied to clipboard

Cleanup tests : remove TestNG

Open lburgazzoli opened this issue 8 years ago • 18 comments

We have some tests using TestNG an some others using JUnit, we need to get rid of TestNG

lburgazzoli avatar Apr 10 '18 05:04 lburgazzoli

could you assign this issue to me?

liukun4515 avatar May 14 '18 16:05 liukun4515

I can't but you are very welcome to submit a pr

lburgazzoli avatar May 14 '18 16:05 lburgazzoli

@liukun4515 just do it.

fanminshi avatar May 14 '18 17:05 fanminshi

ok

liukun4515 avatar May 15 '18 02:05 liukun4515

How to solve the dependency testing using Junit? The JUnit doesn't support the dependency testing. @fanminshi @lburgazzoli use annotation @ FixMethodOrder or custom method runner?

liukun4515 avatar May 15 '18 06:05 liukun4515

@liukun4515 I think every unit test should not depend on any other test so you should set-up etcd according to your need in your test

lburgazzoli avatar May 15 '18 08:05 lburgazzoli

The JUnit doesn't support the dependency testing. I don't think we should have any dependency testing at all. it is generally a bad practice in testing. We want each test to be independent from each other.

fanminshi avatar May 15 '18 19:05 fanminshi

@liukun4515 have you been able to progress on this issue ?

lburgazzoli avatar Jun 22 '18 15:06 lburgazzoli

I've made a start with this issue in #358; that's 1/4 done. The ClusterClientTest, AuthClientTest and LockTest still have to be done (hopefully by others than me) before we can fully remove the testng dependency.

The point re. dependency testing is easy enough to resolve - e.g. in #358 the testDelete() now simply first calls testPut() instead of TestNG's dependsOnMethods. That's simpler, clearer and better than (ab)using JUnit's @FixMethodOrder to replace dependsOnMethods, IMHO.

vorburger avatar Aug 14 '18 12:08 vorburger

@vorburger yes dependsOnMethods and other similar stuffs should be removed, we can also have independant test so a change on one of the methods does not imact all the test.

lburgazzoli avatar Aug 14 '18 12:08 lburgazzoli

Hello there, I'm working on cleaning up the TestNG dependency, and I'm interested if we'd also like to maintain the dependency on AssertJ, it does seem useful, but if we don't want it, then I can clean it up at the same time.

OwlHaus avatar Nov 26 '18 23:11 OwlHaus

@pdfkpb whatever works best for you. Perhaps two separate commits & PRs is simpler to review?

PS: Personally I anyway prefer G's Truth over AssertJ nowadays, but that's not this issue.

vorburger avatar Nov 26 '18 23:11 vorburger

At the moment I would focus to get rid of TestNG only

lburgazzoli avatar Nov 27 '18 16:11 lburgazzoli

@pdfkpb any update ?

lburgazzoli avatar Dec 12 '18 11:12 lburgazzoli

I'm coming to the end of an internship so it's been a bit busy here, but I'll see about getting a pr in by the end of next week.

OwlHaus avatar Dec 12 '18 14:12 OwlHaus

@pdfkpb any update ?

lburgazzoli avatar Feb 13 '19 08:02 lburgazzoli

@lburgazzoli Unfortunately, my virtual machine I was using was compromised and I lost my code, I'd start it over but have work piling up irl

OwlHaus avatar Mar 04 '19 20:03 OwlHaus

@pdfkpb you can do it from one test pkg at a time. No need to have one big PR that fixes everything.

fanminshi avatar Mar 04 '19 20:03 fanminshi