Hi,
I'm having a little trouble getting the developer regression tests to complete. Attached are the outputs from the console where I ran ant drt (testOut.txt) and from the tomcat console (tomcatConsole.txt). I dropped the database, ran clean, drt-clean, default, and drt.
Thanks,
Bill |
|
adam responded: |
2006-06-23 06:46 |
One common cause of this failure: the example run has already been loaded into your CPAS system; CPAS won't allow you to load the same run twice. Check all your folders for this run and delete it. Easiest way to find it is to go to MS2 admin and click the "Successful MS2 Runs" link. Or query the MS2Runs table directly. Adam |
|
wnels2 responded: |
2006-06-23 07:27 |
I dropped the database and ran ran clean, drt-clean before I built CPAS and ran drt. Is there something that might be leftover on the file system? |
|
mbellew responded: |
2006-06-23 07:35 |
When the test fails after testing status for a long time (all those refreshes), it might be that the task is just taking too long. The drt should run fine on a single proc machine. However, I have had the tests fail, when I was doing something else very processor intensive, such that the test couldn't make progress. In general, you can often learn a lot by going to the page in question. E.g. in this case Experiment/MS2VerifyProject/ms2folder/details.view?rowId=4, and see what you can see. Also check the tomcat logs, in particular <tomcat>/logs/cpas.log, though it will mostly be redundant with the console output. |
|
wnels2 responded: |
2006-06-23 08:38 |
That URL looks fine to me when I access it manually. I can't detect any slowness. I can't find anything that is obvious to me in the cpas logs either. I've attached the logs and an image of the offending URL.
Thanks a lot for your help. Bill |
|
|
mbellew responded: |
2006-06-23 09:38 |
Sorry, I don't have more time today. However, I will suggest one more line of attack. The test scripts are actually pretty easy to read. If you open up MS2Test.java in an editor, you can probably just follow the steps by hand, and see what happens. You are one of the lucky first few external developers to try running the DRTs. The good news it that they are run constantly here, so they tend to stay working fairly well. However, when it goes wrong sometimes you have to dig in… |
|
adam responded: |
2006-06-23 10:03 |
Another possibility: The DRT should clean up temporary files before the tests are run, but you might double check /sampledata/xarfiles/ms2pipe/bov_sample for files that haven't been cleaned up. If search results (e.g., pep.xml files) exist in the file system the search won't be re-run. If you're enlisted in the Subversion project, TortoiseSVN makes it fairly easy to spot and delete files that aren't checked in. |
|
wnels2 responded: |
2006-06-23 11:40 |
Thanks for the ideas. I'll get back to you after your vacation.
Bill |
|
wnels2 responded: |
2006-07-18 09:54 |
Well, I ended up going on vacation too.
The test failure was a problem with my computer. The tests are passing now.
I'm now trying to get CPAS to run/debug in an IDE. I am using IntelliJ. (by the way: IntelliJ gave us a free license because we are using it to work on an open source project). I think I have it configured as per you directions but I get the following error when I try to run it: C:SunAppServerjdkbinjava -ea -Xmx768M -Dsun.io.useCanonCaches=false -Djava.endorsed.dirs=C:/CPASInstall/apache-tomcat-5.5.15/common/endorsed -classpath C:/Sun/AppServer/jdk/jre/lib/tools.jar:C:/CPASInstall/apache-tomcat-5.5.15 -Djava.io.tmpdir=C:/CPASInstall/apache-tomcat-5.5.15/temp -Dgroovy.cache=false -Dgroovy.root=C:/CPAS/modules -Ddevmode=true -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:Program FilesJetBrainsIntelliJ IDEA 5.1bin" -Dfile.encoding=windows-1252 com.intellij.rt.execution.application.AppMain org.apache.catalina.startup.Bootstrap start
java.lang.NoClassDefFoundError: com/intellij/rt/execution/application/AppMain
Exception in thread "main"
Process finished with exit code 1 Thanks in advance for any help with my IntelliJ learning curve.
Bill |
|
jeckels responded: |
2006-07-18 10:19 |
You'll need to add another JAR to your -classpath argument. On my machine it's C:/Program Files/JetBrains/IntelliJ IDEA 5.1/lib/idea_rt.jar. Since that path contains a space, you'll need to quote the whole classpath. Josh |
|
wnels2 responded: |
2006-07-19 06:46 |
Thanks, that worked. |
|
wnels2 responded: |
2006-07-19 08:18 |
Sorry, I spoke too soon. I went back to the drt tests and they are not working any more.
The error is :
There was 1 failure:
1) testSteps(cpas.test.web.StudyTest)
Current Page Title = content type is not html
Current Page URL = http://localhost:8080/cpas/admin/showErrorsSinceMark.view
junit.framework.ComparisonFailure: Errors occurred expected:<> but was:<ERROR Global 2006-07-19 10:58:43,546 8080-Processor23 : Unhandled exception caught in Global.app: 401: User does not have permission to perform this operation I can reproduce this by manually going to the page.
One thing that I am doing differently than when I got them to pass is that I am using the IntelliJ svn plugin to down load the project. Before I was downloading zip archive of the source. I have used JUnit with Eclipse and found stepping though the tests with a debugger to be helpful but I haven't been able to figure it out with IntelliJ. Does any one have any suggestions on how to setup a debugger for these tests? Thanks,
Bill |
|
wnels2 responded: |
2006-07-19 08:44 |
I dropped the database and rebuilt everything and it's working. Not a very elegant solution but... If anyone has any info though on how to set up a debugger for the tests I'd be grateful. Thanks,
Bill |
|
adam responded: |
2006-07-19 09:02 |
The operation most likely failed because user is not logged in. If the Tomcat session expires in the middle of the test, for example, the test user will get logged out. Simple fix is to log out before running the DRT (the DRT will log in the test user and get a new session). You could also set a longer session timeout in server.xml. Adam |
|
jeckels responded: |
2006-07-19 10:48 |
If you are running the DRT using the Ant targets, it will listen for a debugger connection on port 5005. You can create an IntelliJ Remote debug configuration to connect to localhost on port 5005. If you use the "drt-debug" Ant target, the tests will wait for the debugger to attach before starting. |
|
wnels2 responded: |
2006-07-24 15:41 |
Hello,
A couple more questions regarding the drt.
- What is the best way to clean-up the test projects. I run drt-clean but I still get the following error:
junit.framework.AssertionFailedError: Cannot create project; A link with text BasicVerifyProject already exists. This project may already exist, or its name appears elsewhere in the UI. Through the application I can delete folders but I can't find a way to delete projects. If I delete the BasicVerifyProject from the core.containers table I get the error: java.lang.IllegalStateException: setWorkingForm must be called before trying to submit. If I drop the database and rebuild everything, it works again. Is there a better way? 2. I have read the help pages but I don't have a clear understanding about how the Remote debug configuration works. I created a remote configuration using the default settings (screen capture attached). I start the drt-debug target, then click Run>Debug (or I click Run>debug and then start the ant drt-debug target). I'm not really sure what is supposed to happen then, but it gives me a cannot connect message.
Thanks,
Bill |
|
|
brittp responded: |
2006-07-25 10:04 |
Hi Bill, First, we should define what "clean-up" means for a DRT. In most cases, it just means deleting the top-level project (and all subfolders) that's created for each test run. If a particular test creates other artifacts, like files on disk, the clean-up step is an opportunity to delete these as well. Each test in the DRT performs a clean up as the first step of running, as well as the last step after a successful run. We do this so that a failure leaves the system in the failed state, which lets the developer figure out what happened. You can manually force a clean of a test using the drt-clean target, which you appear to have discovered. The failure you're seeing running the test indicates that the 'BasicVerifyProject' is still around when BasicTest tries to create its project. This means that the cleanup step either isn't happening, or is failing. Have you modified BasicTest.java in any way? You would see this failure if you had modified the 'doCleanup' method, or if you'd changed the test to create additional folders but had not added lines to delete those folders in 'doCleanup'. If you haven't touched BasicTest.java at all, then there may be an exception occurring on the server when you try to clean up. Have you looked through the server logs (either in cpas.log or in your IntelliJ output window) for an exception stack? A final possibility is that you manually created a folder under BasicVerifyProject at some point after a failed test. The DRT won't know to delete this folder, and as a result won't be able to delete the project. In general, you shouldn't need to directly manipulate the database very often- I drop the entire database once at month at most, and I never delete individual rows from core.Containers. The easiest way to clean up manually is to go to your website and use the Manage Folders UI to delete the contents of the project- work bottom up; you can only delete folders without children. To delete a project, simply delete its folder (through the same Manage Folders UI) after you've deleted all its child folders. Finally, regarding remote debugging: run the drt-debug ant target from a command line first. You'll see some compilation messages, then the following text: "Listening for transport dt_socket at address: 5005". Once this is showing, start your remote debug target within IntelliJ by first choosing it from the debug configuration dropdown, then clicking the debug button. That said, I'm not sure you need to debug your DRT at this point- going down this path adds many variables to the equation (timing changes, etc.), making the whole thing more complicated- you should be able to figure out what's happening without entering the debugger. -Britt |
|
wnels2 responded: |
2006-07-26 12:27 |
Thanks for all of the detail. It really helped. I'm starting to feel like I'm making progress now. The test step that is failing is createSubfolder, line 27 of Basic Test. This test eventually gets to the method clickButtonWithImgString, line 707 of BasicWebTest. The problem is where it gets the form (WebForm form = getDialog().getForm(), line 710) from the page. There is no form on this page. The buttons are anchors with images of buttons. Because the drt fails before it can create the subfolder (childfolder), doCleanup, line 13 of BasicTest, is in the wrong state when it tries to execute the deleteProject method. There are no exceptions thrown during cleanup because they're caught but not thrown at this step. I guess this makes sense because most of the time the folders won't be there. Anyway, I have the mascot version of the src checked out. Are the tests being maintained for this branch? I was able to get the tests to work for the release1.4 branch. Stack trace attached. Thanks again for you time and patience. Bill |
|
|
adam responded: |
2007-01-03 16:06 |
|
|
|
|