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

Script Runner - IntelliJ Test integration

Martin W_ February 20, 2019

Hey,

i was following the following Guide for Testing:
Testing your Code

 

And stumbled into the following Error's while trying to get run the Test from the IDE.

2019-02-20 11:03:20,452 http-nio-8080-exec-7 ERROR admin 663x727x2 1y98v 127.0.0.1 /rest/scriptrunner/latest/canned/com.onresolve.scriptrunner.canned.common.admin.RunUnitTests [c.o.s.c.common.admin.RunUnitTests] *************** FAILED initializationError(org.junit.runner.manipulation.Filter) ********************
2019-02-20 11:03:20,459 http-nio-8080-exec-7 WARN admin 663x727x2 1y98v 127.0.0.1 /rest/scriptrunner/latest/canned/com.onresolve.scriptrunner.canned.common.admin.RunUnitTests [c.o.s.c.common.admin.RunUnitTests] Test: initializationError(org.junit.runner.manipulation.Filter) failed
java.lang.Exception: No tests found matching method name filter from org.junit.runner.Request$1@21909616
at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:40)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at org.junit.runner.JUnitCore$run$0.call(Unknown Source)
at com.onresolve.scriptrunner.canned.common.admin.RunUnitTests.doScript(RunUnitTests.groovy:326)

Thats my corresponding test class:

package de.mycompany.jira.example

import com.onresolve.scriptrunner.canned.common.admin.ScriptRunnerTestRunner
import org.junit.runner.RunWith
import spock.lang.Specification

@RunWith(ScriptRunnerTestRunner)
class TestRunnerSampleSpec extends Specification {

def "test something"() {
expect:
true
}
}

 

i suspect that i have to set the default package for the test, but i don't know where and how.

 

 

Moreover, there was already a similar question in the community, unfortunately no one could answer it.

That's why I link it again

Similar question from mid 2018

 

I am very thankful for ever idea and tipp to get around this issue :)

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Volodymyr Havryliuk June 22, 2019

I was able to run tests from Idea when in field Packages (screenshot) in Jira package with tests was specified.  For example, if you tests are in com.yourcompany.scriptrunner.test, this package should be specified in Jira UI. It took a lot of my time to figure this out.  done.PNG

0 votes
Volodymyr Havryliuk May 29, 2019

I have the same issue.

TAGS
AUG Leaders

Atlassian Community Events