erlide_eclipse icon indicating copy to clipboard operation
erlide_eclipse copied to clipboard

UI for running tests

Open martinpritchard opened this issue 10 years ago • 8 comments

It would be nice if there was a way run to Common Tests for my project within the IDE. Ideally I would like something like we have with JUnit tests - right click on test folder (or module), select Run as CT Test and a nice UI pop up with a red/green bar indicating failure or success, and easy navigation to a failing test and reason for failure.

Is there a recommended approach for running ct/eunit tests as it stands? Currently I have to run a separate shell, and then use a browser to view the html output of my CT run.

martinpritchard avatar Jun 04 '15 11:06 martinpritchard

There is some support, but unfortunately it is not exposed in the UI yet. I will look at the details, it's been a while since I touched that code. I think that if you can configure your setting to be able to run eunit or ct from the shell directly, then it will be relatively easy to implement what is missing. It is almost always the configuration parts that are difficult.

vladdu avatar Jun 04 '15 11:06 vladdu

Please send me a short description of how your code is structured: are all tests in /test/ or in deeper subdirectories? How do you store the configuration (one file or several, what names)? Any other things that I can't guess?

vladdu avatar Jun 04 '15 15:06 vladdu

I use erlang.mk (in favour of rebar), so I use make ct. My ct tests are held in a test folder (no sub folders), named mytest_SUITE.erl. I don't rely on any config.

In general, I run my application as a long lived process and run ct tests separately, testing a running node, using sync to hot code load the changes I make in erlide.

Depending on how much is involved, I may have some capacity to contribute, so if you can offer some pointers on what is involved and how to get started, I may be able to help out.

martinpritchard avatar Jun 04 '15 20:06 martinpritchard

Thank you for the kind offer. Most of the code would involve Java and Eclipse, are you familiar with those? If not, there is unfortunately a steep learning curve.

There are several levels of integration, from just executing "make ct" and opening a browser on the results' page, to a junit-like view with navigation to the code and all the goodies. The latter is a lot of work. I could probably put together something like the former in a few days, but it would be not very configurable (i.e. it might not work for everyone). On the other hand, it's still better than the current situation.

So I think I will start with the simple things - start the tests and show the html results. Then we'll see what features are the most needed. Your feedback will be important here.

BTW, you can connect erlide to the running node by specifying its name and cookie in the run configuration. Then you don't need sync.

vladdu avatar Jun 04 '15 21:06 vladdu

I'm Java and Erlang, I've used eclipse for years but not developed it - something I've wanted to get involved with for some time, this seems like a good excuse. However, this sounds like something quite involved, its probably best if I poke around in the source and keep an eye on any changes you make, then I can possibly make minor contributions that I'm comfortable with.

martinpritchard avatar Jun 05 '15 07:06 martinpritchard

Having someone to discuss the issue with is already very useful.

If you will want to check the code: there is some code in the test_support project, but it is fragmentary. I started to implement support for a homegrown testing framework, but somebody else took over and I have left some parts that I thought would be useful in general.

I think that the following will be good enough for a first step:

  • configure test framework to use and external command to execute tests ("make ct", "rebar eunit" , etc); with this we know where to find the results
  • display the results in a browser or editor (whatever is appropriate)
  • when navigating to the code, open file in editor, not in browser

vladdu avatar Jun 05 '15 07:06 vladdu

Hi Vlad, did you ever make any progress with this issue? I started to take a look around a while back to see if I could get somewhere, but I must admit I got a bit overwhelmed!

martinpritchard avatar Jul 05 '16 21:07 martinpritchard

Hi! Yes and no. I got started, but as you might know, before one can do something, one has to do something else... There are other changes in the pipeline that will affect this and I try to do them in the right order.

Then urgent stuff got in the way and it was hairier than expected. I now officially hate release engineering and maven and groovy scripts in Jenkins :-\ Hopefully I will only have to go through this once.

I am now more or less done with that stuff, but will go on vacation in a few days (for 3 weeks). Thanks for reminding me, please do it again if you don't hear from me in a reasonable time.

vladdu avatar Jul 05 '16 21:07 vladdu