Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369008

Summary: Support deployment testing
Product: [RT] Virgo Reporter: Miles Parker <milesparker>
Component: virgo-buildAssignee: Project Inbox <virgo-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipse, glyn.normington, leo.dos.santos, steffen.pingel
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Miles Parker CLA 2012-01-18 16:40:34 EST
For Virgo IDE at least, I'm definitely feeling the need for deployment testing. While this is especially important for Virgo IDE, it's eally just as relevant for all of the Virgo projects, so I thought I'd put it in Virgo build so that we can all discuss. This may already exist, in which case this is really a request for information, and we'll integrate it into Virgo IDE.

We would be able to capture things like bug 368781 when they are introduced and we'd be a lot more comfortable knowing that all of the user scenarios work, including all of the relvant build steps, and that the build steps match up to the documentation. In fact I don't think I'll feel really comfortable completing bug 364573 until we are able to have automated tests that exercise the major build targets that we're supposed to be supporting. At a minimum, I believe those are:

1. 2.0.0
2. 3.0.2 (i.e. pre directory changes)
3. 3.5.0

These would be more integration / systems tests than unit tests, and would involve more than setting up some unit tests but it should all be manageable from a set of shell scripts residing on hudson. We'd also have to have runnable installations of Virgo servers. Again this might already exist. We could use greenpages and any other good test apps for the scenarios. This would not have to be part of the regular builds, we could set it up as a seperate Hudson job.

For the basic server scenario I see something like:

1. Grab latest Greenpages from git.
2. Build the distro from ground-up as described in http://wiki.eclipse.org/Virgo/Build#Building_Individual_Repositories. Leo and I had a bit of stumbling getting this working, but there might be a fully automated build somewhere in any case.
3. Build the standalone greenpages as described here
http://www.eclipse.org/virgo/documentation/greenpages-documentation-2.4.0.RELEASE/docs/htmlsingle/greenpages-guide.html#installation.dmserver.
4. Download and install each of the server runtimes above.
5. Start up dbs and do deployments again as described above.
6. Start up greenpages.
7. Confirm with a very simple set of POSTs that the web app works as expected.

For Virgo IDE, it would be similar:

1&2. As above.
3. Import into Eclipse IDE using the current Virgo IDE build with a specified target platform.
4. Trigger build, including any Maven related bits that need to happen.
5,6,7. As above.

What do people think? I know it sounds like a good deal of work, but I think it could be worth it especially as we would then be able to test against multiple OS's different configuration scenarios, Nano vs. other distros, etc..
Comment 1 Miles Parker CLA 2012-01-18 16:47:37 EST
Missed a step there. IDE should be:

1&2. As above.
3. Import into Eclipse IDE using the current Virgo IDE build with a specified target platform.
4. Trigger build, including any Maven related bits that need to happen.
5. _Configure and launch server using SWT Bot or some other automated approach. _
6. As 5,6,7 above.
Comment 2 Glyn Normington CLA 2012-02-27 10:39:25 EST
This is a great suggestion.

Currently, the closest we have are the system verification tests which unzip and start a provided Virgo Tomcat Server zip file and then run JUnit tests which deploy applications and test the results by driving external interfaces such as the admin console. Perhaps the automation that the JUnit tests use is worth considering for these end-to-end tests.

The crunch question from my perspective is how on earth would we automate the Eclipse IDE operations? If we did manage to automate them, would these tests be relatively stable or would they need reworking frequently as Eclipse evolves?
Comment 3 Miles Parker CLA 2012-03-13 14:00:36 EDT
(In reply to comment #2)

> The crunch question from my perspective is how on earth would we automate the
> Eclipse IDE operations? If we did manage to automate them, would these tests be
> relatively stable or would they need reworking frequently as Eclipse evolves?

Actually, that bit isn't too difficult. We already have working support for SWTBot testing thanks to Leo and Steffen. We'd just need to ensure that we have a working server target, then drive the Server wizards to creating adapters for the various servers and starting them. The hard part in all of this is coming up with appropriate wait times before making the next UI change.
Comment 4 Glyn Normington CLA 2012-03-14 06:46:44 EDT
(In reply to comment #3)
> (In reply to comment #2)
> 
> > The crunch question from my perspective is how on earth would we automate the
> > Eclipse IDE operations? If we did manage to automate them, would these tests be
> > relatively stable or would they need reworking frequently as Eclipse evolves?
> 
> Actually, that bit isn't too difficult. We already have working support for
> SWTBot testing thanks to Leo and Steffen. We'd just need to ensure that we have
> a working server target, then drive the Server wizards to creating adapters for
> the various servers and starting them. The hard part in all of this is coming
> up with appropriate wait times before making the next UI change.

Absolutely. In fact I think wait times are probably the wrong solution especially as some CI servers seem to run very slowly. Is there no way for the SWTBot to report back when an operation is complete?
Comment 5 Miles Parker CLA 2012-03-20 15:15:29 EDT
(In reply to comment #4)
> Absolutely. In fact I think wait times are probably the wrong solution
> especially as some CI servers seem to run very slowly. Is there no way for the
> SWTBot to report back when an operation is complete?

That's one of the big weaknesses of using SWTBot actually..since the interaction with the functionality under testing is often inherently asynchronous and there is no way to trigger a callback from say invoking a menu defined by an extension point. I suppose some things could be rigged with mock objects and what not but that seems like it could lead us down the rabbit hole. It's basically the halting problem, right?
Comment 6 Glyn Normington CLA 2012-03-22 04:00:20 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > Absolutely. In fact I think wait times are probably the wrong solution
> > especially as some CI servers seem to run very slowly. Is there no way for the
> > SWTBot to report back when an operation is complete?
> 
> That's one of the big weaknesses of using SWTBot actually..since the
> interaction with the functionality under testing is often inherently
> asynchronous and there is no way to trigger a callback from say invoking a menu
> defined by an extension point. I suppose some things could be rigged with mock
> objects and what not but that seems like it could lead us down the rabbit hole.
> It's basically the halting problem, right?

Unless we can get a notification that asynchronous operations are now complete, yes, it's pretty much the halting problem.

So perhaps the best engineering solution would be to request an enhancement to SWTBot and pre-req. that. SWTBot changes may then need to pre-req. a change to SWT I guess.

I suppose we could limp along meanwhile with wait times, but we'd probably have to make them massively larger than anticipated so we don't get caught out regularly on slow CI servers and such like. This could make the job very long running, but it wouldn't consume much CPU, so perhaps that wouldn't really matter so long as other jobs didn't get blocked by it.
Comment 7 Miles Parker CLA 2012-03-22 12:59:01 EDT
(In reply to comment #6)
> Unless we can get a notification that asynchronous operations are now complete,
> yes, it's pretty much the halting problem.

But even with the notifications, right? I mean, imagine you add the greengages app to a runtime and start it. Then that should trigger the runtime starting. Even if the runtime could trigger a callback to the Test -- say by simply writing to a socket we're listening on -- you still wouldn't know if there was a problem until/unless the server actually responded, or at some arbitrary point you'd assume that it had failed. So you'd need a heuristic in any case.

We're just using JUnit with SWTBot, so I *think* it actually isn't an SWTBot issue per se, it's more of a natural limitation with the underlying approach.

In practice though I don't want to inflate the issue. With the typical UI cases it really isn't the hard to get stay well within a small range. If we have this setup as a separate system test that doesn't affect actual build delivery we could maintain the results pretty easily -- if you see something apparently failing, look at the delay time and adjust and vis. vs.
Comment 8 Glyn Normington CLA 2012-03-22 13:01:20 EDT
(In reply to comment #7)
> (In reply to comment #6)
> > Unless we can get a notification that asynchronous operations are now complete,
> > yes, it's pretty much the halting problem.
> 
> But even with the notifications, right? I mean, imagine you add the greengages
> app to a runtime and start it. Then that should trigger the runtime starting.
> Even if the runtime could trigger a callback to the Test -- say by simply
> writing to a socket we're listening on -- you still wouldn't know if there was
> a problem until/unless the server actually responded, or at some arbitrary
> point you'd assume that it had failed. So you'd need a heuristic in any case.
> 
> We're just using JUnit with SWTBot, so I *think* it actually isn't an SWTBot
> issue per se, it's more of a natural limitation with the underlying approach.
> 
> In practice though I don't want to inflate the issue. With the typical UI cases
> it really isn't the hard to get stay well within a small range. If we have this
> setup as a separate system test that doesn't affect actual build delivery we
> could maintain the results pretty easily -- if you see something apparently
> failing, look at the delay time and adjust and vis. vs.

Yeah, ok. We've had problems with other wait-based tests and I am simply a bit nervous about adding more. But you may be right that it is unavoidable for certain categories of test, so feel free to press on.
Comment 9 Miles Parker CLA 2012-03-22 13:04:17 EDT
(In reply to comment #8)
> Yeah, ok. We've had problems with other wait-based tests and I am simply a bit
> nervous about adding more. But you may be right that it is unavoidable for
> certain categories of test, so feel free to press on.

I think you're right to be nervous. :) I'm thinking that anything that Virgo does in this area should *not* be part of the main builds but run as a completely separate virgo job.