Hey all,
I am trying to get our integration tests running but have run into a couple of obstacles. Basically my idea was to implement int tests based on selenium and page objects but I don't seem to be able to fire them up. I try running the following command on a ubuntu x64 machine with xvfb enabled:
atlas-integration-test -Dhttp.proxyPort=XXXX -Dhttp.proxyHost=ProxyHost --plugins list_of_dependant_plugins_required
As far as I understand this should build my plugin, fire up a JIRA instance and run the tests on it. In my case, however, it tries to start jira, starts waiting, cannot access the instance and fails even before executing the int tests. I get the following:
[INFO] Waiting for http://jiralab2:2990/jira
[INFO] Waiting for http://jiralab2:2990/jira
[INFO] Waiting for http://jiralab2:2990/jira
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13:39 min
[INFO] Finished at: 2016-02-19T11:33:16+01:00
[INFO] Final Memory: 84M/326M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.atlassian.maven.plugins:maven-jira-plugin:5.0.4:integration-test (default-integration-test) on project swisscom-custom-reports: The product jira didn't start after 600s at http://jiralab2:2990/jira. Last response code is 503 -> [Help 1]
[ERROR]
Even though the instance, fired by maven, is indeed started - I can access it, log in and see my test data loaded.
Here's my build config in the pom:
<build> <plugins> <plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-jira-plugin</artifactId> <version>${amps.version}</version> <extensions>true</extensions> <configuration> <functionalTestPattern>it/**/Test*.java</functionalTestPattern> <productVersion>${jira.version}</productVersion> <productDataPath>${basedir}/src/test/resources/generated-test-resources.zip</productDataPath> <jvmArgs>-Xmx4096m -Xms1024m -XX:MaxMetaspaceSize=1024m</jvmArgs> <systemPropertyVariables> <xvfb.enable>${xvfb.enable}</xvfb.enable> </systemPropertyVariables> <testGroups> <testGroup> <id>jira-integration</id> <productIds> <productId>jira</productId> </productIds> <includes> <include>it/**/*Test.java</include> </includes> </testGroup> </testGroups> </configuration> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> </plugins> </build>
Does anyone have an idea what's wrong here? I cannot find anything on the web for this.
Thanks for reading!
Community moderators have prevented the ability to post new answers.
you could pass
com.atlassian.jira.startup.LauncherContextListener.SYNCHRONOUS=true
as a parameter to maven-amps-plugin to disable asynchronous JIRA start eg:.
<groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-amps-plugin</artifactId> <configuration> ... <jvmArgs>-Dcom.atlassian.jira.startup.LauncherContextListener.SYNCHRONOUS=true</jvmArgs>
Hi,
JIRA now starts asynchronously. Therefore you have to wait until JIRA is ready.
package it.com.decadis.test.helper; import org.apache.log4j.Logger; import org.apache.wink.client.Resource; import org.apache.wink.client.RestClient; import org.junit.BeforeClass; import org.junit.Test; public class LittleJira7Helper { private static final Logger log = Logger.getLogger(LittleJira7Helper.class); @BeforeClass public static void waitForJira7() { String testApi = System.getProperty("baseurl") + "/rest/api/2/field"; RestClient restClient = new RestClient(); Resource resource = restClient.resource(testApi); int returnCode = 503; while ( returnCode == 503 ) { returnCode = resource.get().getStatusCode(); if ( returnCode == 503 ) { log.error("JIRA is still unavailable! Waiting 5 seconds..."); } try { Thread.sleep(5000); } catch (InterruptedException e) { } } } @Test public void test() { // JIRA is now ready... } }
I had the same problem but running this code before every test helps.
Kind regards,
Daniel John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you follow all the steps described here https://developer.atlassian.com/jiradev/jira-platform/guides/other/tutorial-writing-integration-tests-for-your-jira-plugin
Do you have localtest.properties with the following contents ?
jira.protocol = http jira.host = localhost jira.port = 2990 jira.context = /jira jira.edition = all jira.xml.data.location = src/test/xml
Note that you don't have to pass all parameters from the command line - you can include the required plugins into the pom as well as the proxyPort I think.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm that tutorial seems to be really old.
I'm struggling with something similar at the moment.
https://answers.atlassian.com/questions/35753113
The rest api seems to be dead as well.
Do You have a working example project by any chance?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do have the localtest.properties file configured but still doesn't work and it's not being able to connect to the started instance.
I haven't followed the tutorial exactly as I'm trying to base the integration tests on FuncTest but rather that com.atlassian.selenium.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.