Atlassian Plugin Test Console and QuickReload

Jörg March 3, 2016

This question is in reference to Atlassian Developer Documentation: Run Wired Tests with the Plugin Test Console

Enabling QuickReload requires disabling FastDev. But without Fastdev, the Plugin Test Console no longer works.

Is there another way to run integration tests in the running instance?

5 answers

4 votes
Christophe Merlotti December 14, 2016

Hi guys,

same problem here, I might have a solution.
The plugin test console tries to call FastDev at 'rest/fastdev/1.0/reload/withtests' to reload the test classes.
As the job is already done by QuickReload, all you need is a plugin that answers a 204 to this call.

What you need is :

  • create a plugin with the following REST module :
<rest key="rest-resource-withtest" path="/fastdev" version="1.0"/>
  • add the following class in the plugin:
@Provider
@Path("/")
public class FastDefReloadWithTests {
	@POST
	@Consumes({MediaType.APPLICATION_JSON})
	@Path("/reload/withtests")
	@AnonymousAllowed
	public Response withTest() {
		return Response.status(Response.Status.NO_CONTENT).build();
	}
}
  • package install the plugin somewhere in a maven repo
  • add it as pluginArtifact in the amps configuration in your original plugin

This worked fine for me. I just have to mvn package my changes so that quickreload detects it. When it's done the console runs the new version of my tests.

Hope this helps.

Andrey Rychkov November 25, 2018

Many thanks!

Also added excluding XSRF protection.

@Path("/")
public class FastDefReloadWithTests {

@POST
@Path("/reload/withtests")
@AnonymousAllowed
@XsrfProtectionExcluded
public Response withTest() {
return Response.status(Response.Status.NO_CONTENT).build();
}
}
2 votes
Immo Hüneke November 30, 2018

I've implemented Christophe Merlotti's proposal as a small Jira plugin, which is free to use. Just add the following to the maven-jira-plugin in your POM:

 <pluginArtifact>
<groupId>com.zuhlke.testing</groupId>
<artifactId>atlassian-plugin-test-console-enabler</artifactId>
<version>1.0.0</version>
</pluginArtifact>

If you try to run unit tests from the console, they will fail. Use for the wired tests only.

You can see the source code at https://github.com/zuhlke/atlassian-plugin-test-console-enabler and my example plugin, which uses this, is stored under https://github.com/zuhlke/example-jira-plugin. A tutorial that explains how this was developed is about to be published under https://www.zuehlke.com/blog/en/?p=25203.

Bohdan Belokur April 10, 2020

Thank you a lot!

0 votes
Andrew S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 13, 2020

Sorry the test console is not working, I've logged this as https://ecosystem.atlassian.net/browse/AMPS-1530.

0 votes
Rafael Franco
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 12, 2016

Same here... how can we run Wired tests with quickreload?

Immo Huneke January 15, 2019

My plugin has now been accepted in to the Atlassian marketplace. See https://marketplace.atlassian.com/apps/1219931/enabler-for-plugin-test-console?hosting=server&tab=overview

The instructions for use are as in Christophe Merlotti's answer above.

In theory, it should be possible to invoke the wired tests using a REST API. You'd have to put the inspector on while running the console to see what it triggers when you press "rerun all wired test classes".

0 votes
Tomasz Stec
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.
April 28, 2016

I am looking for the same inforamtion too! How to run any type of integration/functional tests from inside already started and running JIRA.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events