Unable to run integration tests for JIRA Service Desk


#1

Hey there

I have just a single integration test for my plugin but I’m not sure if I’m doing it right…I have a few issues with integration tests…here is my class:

    @Before
    public void setUpTest() {
        backdoor.darkFeatures().loginAs("admin", "admin");
    }

    @Test
    public void testPluginAdminConfigPage() {
        navigation.gotoAdmin();
        navigation.gotoPage("/secure/admin/plugins/handler/PluginAdminConfigAction.jspa");
        textAssertions.assertTextPresent("E-Mail-Handler Konfiguration");
    }

So if I start my test in eclipse I can see this output in my console:

. ===FTC Started : it.de.scag.jira.plugin.mailhandler.PluginAdminConfigTest.testPluginAdminConfigPage #1 of 0
	.	 Backdoor GET    in    99ms  /log/info
. Checking that JIRA is setup and ready to be tested...
. Got: http://megara:32083/ in 49ms
. Got: http://megara:32083/login.jsp in 41ms
. Got: http://megara:32083/login.jsp in 25ms
. Got: http://megara:32083/ in 1613ms
. JIRA is setup and 'admin' is logged in. !! IT IS DIFFICULT TO MAKE PREDICTIONS, ESPECIALLY ABOUT THE FUTURE !!
	.	 Backdoor GET    in    30ms  /darkFeatures/site/enable
	. failed to disable onboarding 
	. com.sun.jersey.api.client.UniformInterfaceException: Client response status: 404
	. 	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:688)
	. 	at com.sun.jersey.api.client.WebResource.get(WebResource.java:193)
	. 	at com.atlassian.jira.testkit.client.BackdoorControl.get(BackdoorControl.java:81)
	. 	at com.atlassian.jira.testkit.client.DarkFeaturesControl.enableForSite(DarkFeaturesControl.java:38)
	. 	at com.atlassian.jira.functest.framework.FuncTestCase.setUp(FuncTestCase.java:222)
	. 	at junit.framework.TestCase.runBare(TestCase.java:132)
	. 	at com.atlassian.jira.functest.framework.FuncTestCase.runBare(FuncTestCase.java:370)
	. 	at junit.framework.TestResult$1.protect(TestResult.java:110)
	. 	at junit.framework.TestResult.runProtected(TestResult.java:128)
	. 	at junit.framework.TestResult.run(TestResult.java:113)
	. 	at junit.framework.TestCase.run(TestCase.java:124)
	. 	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	. 	at junit.framework.TestSuite.run(TestSuite.java:238)
	. 	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	. 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	. 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	. 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	. 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	. 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	. 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
	. 
	. failed to disable BigPipe 
	. com.sun.jersey.api.client.UniformInterfaceException: Client response status: 404
	. 	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:688)
	. 	at com.sun.jersey.api.client.WebResource.get(WebResource.java:193)
	. 	at com.atlassian.jira.functest.framework.backdoor.InstanceFeaturesControl.isEnabled(InstanceFeaturesControl.java:14)
	. 	at com.atlassian.jira.functest.framework.FuncTestCase.lambda$setUp$0(FuncTestCase.java:230)
	. 	at java.util.Optional.filter(Optional.java:178)
	. 	at com.atlassian.jira.functest.framework.FuncTestCase.setUp(FuncTestCase.java:230)
	. 	at junit.framework.TestCase.runBare(TestCase.java:132)
	. 	at com.atlassian.jira.functest.framework.FuncTestCase.runBare(FuncTestCase.java:370)
	. 	at junit.framework.TestResult$1.protect(TestResult.java:110)
	. 	at junit.framework.TestResult.runProtected(TestResult.java:128)
	. 	at junit.framework.TestResult.run(TestResult.java:113)
	. 	at junit.framework.TestCase.run(TestCase.java:124)
	. 	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	. 	at junit.framework.TestSuite.run(TestSuite.java:238)
	. 	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	. 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	. 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	. 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	. 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	. 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	. 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
	. 
	.	 going to admin page via URL
. Got: http://megara:32083/secure/project/ViewProjects.jspa in 164ms
. Got: http://megara:32083/secure/admin/plugins/handler/PluginAdminConfigAction.jspa in 91ms
	.	 Logging out
. Got: http://megara:32083/secure/Logout!default.jspa?atl_token=AMAQ-KOIU-T0BZ-87SN%7C245733b9735db6d65981ac545602b9a5e38d27ce%7Clin in 40ms
. ===FTC Finished : it.de.scag.jira.plugin.mailhandler.PluginAdminConfigTest.testPluginAdminConfigPage #1 of 0 (0,0%) : Errors 0 (0,0%) : Run time 3,75 seconds : Suite time 3,63 seconds : HTTP Count 7 : HTTP Time 2023ms : HTTP Ave 0,29 ms/request : HTTP 100th 1613ms : HTTP 90th 1613ms : HTTP 50th 49ms : Parse Time 279372544nanos : Parse Count 4 : Max Mem 3793747968 : Total Mem 257425408  : Free Mem 202471616
. ______________________________
. 
	.	 Backdoor GET    in    29ms  /log/info

But when I try to execute it from command line with “atlas-integration-test” my test are acctually not executed…instead I get a strange error message…

[INFO] --- maven-jira-plugin:6.3.4:generate-manifest (default-generate-manifest) @ mailhandler ---
[INFO] Generating a manifest for this plugin
[INFO] using maven-bundle-plugin v2.5.3
[WARNING] Manifest de.scag.jira.plugin:mailhandler:atlassian-plugin:1.0.0 : Unused Import-Package instructions: [javax.xml.bind*, org.eclipse.gemini.blueprint.*, org.apache.http.*]
[INFO]
[INFO] --- maven-jira-plugin:6.3.4:generate-test-manifest (default-generate-test-manifest) @ mailhandler ---
[INFO]
[INFO] --- maven-jira-plugin:6.3.4:validate-manifest (default-validate-manifest) @ mailhandler ---
[INFO] Manifest found, validating...
[INFO] Manifest validated
[INFO]
[INFO] --- maven-jira-plugin:6.3.4:jar (default-jar) @ mailhandler ---
[INFO] Building jar: C:\workspace\mailrequest-to-issue-handler\target\mailhandler-1.0.0.jar
[INFO]
[INFO] --- maven-jira-plugin:6.3.4:generate-obr-artifact (default-generate-obr-artifact) @ mailhandler ---
[INFO] using maven-bundle-plugin v2.5.3
[INFO] Installing mailhandler-1.0.0.jar
[INFO] Writing OBR metadata
[INFO] Building jar: C:\workspace\mailrequest-to-issue-handler\target\mailhandler-1.0.0.obr
[INFO]
[INFO] --- maven-jira-plugin:6.3.4:validate-test-manifest (default-validate-test-manifest) @ mailhandler ---
[INFO] Manifest found, validating...
[INFO] Manifest validated
[INFO]
[INFO] --- maven-jira-plugin:6.3.4:test-jar (default-test-jar) @ mailhandler ---
[INFO] Building jar: C:\workspace\mailrequest-to-issue-handler\target\mailhandler-1.0.0-tests.jar
[INFO]
[INFO] --- maven-jira-plugin:6.3.4:prepare-database (default-prepare-database) @ mailhandler ---
[INFO] No dataSource configured for pre-integration-test
[INFO]
[INFO] --- maven-jira-plugin:6.3.4:integration-test (default-integration-test) @ mailhandler ---
[INFO] Configured Artifact: com.atlassian.jira.plugins:jira-plugin-test-resources:7.3.6:zip
[INFO] com.atlassian.jira.plugins:jira-plugin-test-resources:7.3.6:zip already exists in C:\workspace\mailrequest-to-issue-handler\target\jira
[INFO] Configured Artifact: com.atlassian.jira:atlassian-jira-webapp:7.3.6:war
[INFO] com.atlassian.jira:atlassian-jira-webapp:7.3.6:war already exists in C:\workspace\mailrequest-to-issue-handler\target\jira
[INFO] Configured Artifact: com.atlassian.jira.tests:jira-testkit-plugin:7.2.11:jar
[INFO] Copying jira-testkit-plugin-7.2.11.jar to C:\workspace\mailrequest-to-issue-handler\target\jira\home\plugins\installed-plugins\jira-testkit-plugin-7.2.11.jar
[INFO] Configured Artifact: com.atlassian.pdkinstall:pdkinstall-plugin:0.6:jar
[INFO] Copying pdkinstall-plugin-0.6.jar to C:\workspace\mailrequest-to-issue-handler\target\jira\home\plugins\installed-plugins\pdkinstall-plugin-0.6.jar
[INFO] Configured Artifact: commons-fileupload:commons-fileupload:1.2.1:jar
[INFO] Copying commons-fileupload-1.2.1.jar to C:\workspace\mailrequest-to-issue-handler\target\jira\home\plugins\installed-plugins\commons-fileupload-1.2.1.jar
[INFO] Configured Artifact: org.apache.felix:org.apache.felix.webconsole:1.2.8:jar
[INFO] Copying org.apache.felix.webconsole-1.2.8.jar to C:\workspace\mailrequest-to-issue-handler\target\jira\home\plugins\installed-plugins\org.apache.felix.webconsole-1.2.8.jar
[INFO] Configured Artifact: org.apache.felix:org.osgi.compendium:1.2.0:jar
[INFO] Copying org.osgi.compendium-1.2.0.jar to C:\workspace\mailrequest-to-issue-handler\target\jira\home\plugins\installed-plugins\org.osgi.compendium-1.2.0.jar
[INFO] Configured Artifact: com.atlassian.labs.httpservice:httpservice-bridge:0.6.2:jar
[INFO] Copying httpservice-bridge-0.6.2.jar to C:\workspace\mailrequest-to-issue-handler\target\jira\home\plugins\installed-plugins\httpservice-bridge-0.6.2.jar
[INFO] Configured Artifact: com.atlassian.devrel:developer-toolbox-plugin:2.0.17:jar
[INFO] Copying developer-toolbox-plugin-2.0.17.jar to C:\workspace\mailrequest-to-issue-handler\target\jira\home\plugins\installed-plugins\developer-toolbox-plugin-2.0.17.jar
[INFO] Configured Artifact: com.atlassian.labs:rest-api-browser:3.1.3:jar
[INFO] Copying rest-api-browser-3.1.3.jar to C:\workspace\mailrequest-to-issue-handler\target\jira\home\plugins\installed-plugins\rest-api-browser-3.1.3.jar
[INFO] Configured Artifact: com.atlassian.plugins:plugin-data-editor:1.2:jar
[INFO] Copying plugin-data-editor-1.2.jar to C:\workspace\mailrequest-to-issue-handler\target\jira\home\plugins\installed-plugins\plugin-data-editor-1.2.jar
[INFO] Configured Artifact: com.atlassian.labs.plugins:quickreload:1.24.1:jar
[INFO] Copying quickreload-1.24.1.jar to C:\workspace\mailrequest-to-issue-handler\target\jira\home\plugins\installed-plugins\quickreload-1.24.1.jar
[INFO] Extracting C:\Users\abdel-mola\.m2\repository\com\atlassian\servicedesk\jira-servicedesk-application\3.2.8\jira-servicedesk-application-3.2.8.obr into C:\workspace\mailrequest-to-issue-handler\target\jira\home\plugins\installed-plugins
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.143s
[INFO] Finished at: Fri Dec 15 16:43:02 CET 2017
[INFO] Final Memory: 36M/372M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.atlassian.maven.plugins:maven-jira-plugin:6.3.4:integration-test (default-integration-test) on project mailhandler: archive is not a ZIP archive -> [Help 1]

It fails when maven trys to extract the service desk application from the repo, which is not working with a .obr file. I have absolutly no clue why he try to extract a obr file…can anyone please explain me how to manage integration tests for JIRA Plugins?

Regards