Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

atlas-integration-test not being able to access fired Jira instance

Slavina Sobadjieva February 18, 2016

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!

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Tomasz Kanafa
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 6, 2016

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>
0 votes
Daniel John
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2016

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

0 votes
Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2016

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.

eXtensi Admin February 21, 2016

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.

http://localhost:2990/jira/plugins/servlet/restbrowser#/resource/atlassiantestrunner-1-0-runtest-testclassname

 

Do You have a working example project by any chance?

 

Slavina Sobadjieva February 29, 2016

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. 

 

Support Apwide July 16, 2016

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events