Re: Use pre-integration-test to start instamo, run tests in integration-test, then stop instamo in post-integration-test?

2013-03-21 Thread Corey Nolet
Generally, you'd place it on the developer making changes to run their integration tests before checking in to keep jenkin's from whining about busted tests. The Proxy tests are quite slow right now and there's some duplication in the more detailed unit tests. The SimpleTest runs everything in a mi

Re: Use pre-integration-test to start instamo, run tests in integration-test, then stop instamo in post-integration-test?

2013-03-21 Thread David Medinets
Who is in charge of changing the Jenkins configuration? It would be nice to know if the build process executes the integration-test phase. By default, integration-test runs test classes named **/IT*.java, **/*IT.java, and **/*ITCase.java. Once the Jenkins build is confirmed, then renaming the long-

Re: Using powermock-api-mockito in tests?

2013-03-21 Thread dlmarion
So we are getting into an area where you want to compile the software on a platform that is not supported. If you want to compile on an unsupported platform, then I would suggest just ignoring the tests that won't work on that system. I don't think that this needs to be changed now as Hadoop

Re: Using powermock-api-mockito in tests?

2013-03-21 Thread David Medinets
I hate ignoring things. It makes me uneasy. I'm looking at the other tests as well. For example, the AccumuloDFSBase class depends on running /bin/sh to find a umask. No reason that dependency can't be mocked out during testing... If nothing else, this research will form my own set of Accumulo Zen

Re: Using powermock-api-mockito in tests?

2013-03-21 Thread dlmarion
Take a look at my other email on this subject, it might be better to just add the profile that I mentioned and add this to the list of ignored tests for now. I know that there is a ticket for removing ACCUMULO_HOME in all places. - Original Message - From: "David Medinets" To: dev@ac

Re: Use pre-integration-test to start instamo, run tests in integration-test, then stop instamo in post-integration-test?

2013-03-21 Thread Tim Reardon
+1 for Corey. In other projects I've seen alot of mileage out of moving longer running tests to an "it" profile that Hudson/Jenkins runs by default, alleviating some of the burden for developers of running a basic mvn clean install while still maintaining a fallback via the CI build. On Thu, Mar

Re: Using powermock-api-mockito in tests?

2013-03-21 Thread David Medinets
Dave, you were very close. Here is the mocking code that I used. Map mockSystemProperties = new HashMap(); mockSystemProperties.put("ACCUMULO_HOME", System.getenv("HOME")); PowerMock.mockStaticPartial(System.class, "getenv"); EasyMock.expect(System.getenv()).andReturn(moc

Re: Using powermock-api-mockito in tests?

2013-03-21 Thread dlmarion
I do think that the tests that use the MiniDFSCluster (anything that uses AccumuloDFSBase) will fail on Windows. I had to use the following profile in the commons vfs package. Of course the test names will be different here... hdfs false Windows org.apache.maven.plugins mave

Re: Using powermock-api-mockito in tests?

2013-03-21 Thread dlmarion
I'm not seeing where. Do you have a stack trace? - Original Message - From: "David Medinets" To: dev@accumulo.apache.org Sent: Thursday, March 21, 2013 9:26:25 PM Subject: Re: Using powermock-api-mockito in tests? The AccumuloVFSClassLoaderTest tests require ACCUMULO_HOME to be def

Re: Using powermock-api-mockito in tests?

2013-03-21 Thread David Medinets
The AccumuloVFSClassLoaderTest tests require ACCUMULO_HOME to be defined. It is not defined on my Windows computer. Therefore, the tests failed. I argue that a unit test should be independent of the underlying system otherwise it is some kind of integration or functional test. And in this case, moc

RE: Using powermock-api-mockito in tests?

2013-03-21 Thread Dave Marion
The Hadoop MiniDFSCluster won't work on Windoze. He'll have to exclude most of the new classloader tests from running on that platform. -Original Message- From: Josh Elser [mailto:josh.el...@gmail.com] Sent: Thursday, March 21, 2013 6:44 PM To: dev@accumulo.apache.org Subject: Re: Usi

Re: Using powermock-api-mockito in tests?

2013-03-21 Thread Josh Elser
David is trying to build on Windows. On 03/21/2013 06:40 PM, Dave Marion wrote: Out of curiosity, why do you say that " System.getenv() which breaks the tests in AccumuloVFSClassLoaderTest?" It's worked fine for a while. What is different now? -- Dave -Original Message- From: dlmar...

RE: Using powermock-api-mockito in tests?

2013-03-21 Thread Dave Marion
Out of curiosity, why do you say that " System.getenv() which breaks the tests in AccumuloVFSClassLoaderTest?" It's worked fine for a while. What is different now? -- Dave -Original Message- From: dlmar...@comcast.net [mailto:dlmar...@comcast.net] Sent: Thursday, March 21, 2013 5:12 PM

Re: Using powermock-api-mockito in tests?

2013-03-21 Thread dlmarion
We can do it with PowerMock, no need to add  Mockito. This should work, going from memory here. I should be able to help when I get back to a computer if you have problems.   //Mock the method   PowerMock.mockStatic(System.class, System.class.getMethod("getenv"));   //Invoke it   Ma

Using powermock-api-mockito in tests?

2013-03-21 Thread David Medinets
Is there any reason why I should not add a dependency in start/pom.xml to powermock-api-mockito? With this library, we can mock the call to System.getenv() which breaks the tests in AccumuloVFSClassLoaderTest. The two tests need these four lines of setup in order to pass: Map mockSystemPrope

Re: Defining ACCUMULO_HOME for Windows Unit Tests

2013-03-21 Thread Keith Turner
Some of the unit test in Start use the HDFS MiniDFSCluster. I wonder if MiniDFSCluster works on windows. As a test, you could try removing the test in org.apache.accumulo.start.classloader.vfs.providers, I think these are the ones that use MiniDFS. On Wed, Mar 20, 2013 at 11:31 PM, David Medine

Re: Use pre-integration-test to start instamo, run tests in integration-test, then stop instamo in post-integration-test?

2013-03-21 Thread Keith Turner
On Thu, Mar 21, 2013 at 6:31 AM, David Medinets wrote: > Running org.apache.accumulo.proxy.SimpleTest > Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 37.844 > sec <<< FAILURE! > > I am continued to be concerned by this unit test in the proxy module. > And a few others that are lo

RE: Use pre-integration-test to start instamo, run tests in integration-test, then stop instamo in post-integration-test?

2013-03-21 Thread Corey Nolet
Would it also help to define the integration tests in a maven profile that hudson runs by default? I just added some tests that use the mini cluster to verify that proper exceptions are being thrown and it slows down the build as well. Sent from my Verizon Wireless 4G LTE Smartphone

Use pre-integration-test to start instamo, run tests in integration-test, then stop instamo in post-integration-test?

2013-03-21 Thread David Medinets
Running org.apache.accumulo.proxy.SimpleTest Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 37.844 sec <<< FAILURE! I am continued to be concerned by this unit test in the proxy module. And a few others that are long-running. I haven't found time to dig into the code but I assume