Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java test runner for vs code stuck at resolving launch configuration

A couple of days ago, everyone working on my project lost the ability to run tests directly from vs code test runner. If you click on the green arrow, a dialog opens in the bottom right corner with the message, "Run Tests: Resolving launch configuration". After that, nothing happens. The dialog box stays open forever.

dialog box image
enter image description here

I can run tests using maven so this leads me to believe the java test runner plugin is broken. Since everyone had the same problem at the same time and the tests run with maven, it seems that it must have something to do with an update. Any thoughts on the matter would be appreciated.

Update: I have narrowed the parameters down to test classes with more than one test method. If there is just one test, it runs fine. I just know this is going to be a forehead slapper when it is figured out.

this fails

package com.broken;
import static org.assertj.core.api.Assertions.*;
import org.testng.annotations.Test;

/**
 * This fails
*/
public class TestNgTwoTests {
    @Test
    public void testOne(){
        assertThat(true).as("I am the first test").isTrue();
    }
    @Test
    public void testTwo(){
        assertThat(true).as("I am the second test").isTrue();
    }
}

this works

package com.broken;
import static org.assertj.core.api.Assertions.*;
import org.junit.Test;

/**
 * This works
*/
public class JUnitTwoTests {
    
    @Test
    public void testOne(){
        assertThat(true).as("I am the first test").isTrue();
    }
    @Test
    public void testTwo(){
        assertThat(true).as("I am the second test").isTrue();
    }
}

this works

package com.broken;
import static org.assertj.core.api.Assertions.*;
import org.testng.annotations.Test;

/**
 * This works
*/
public class TestNgOneTest {
    @Test
    public void testOne(){
        assertThat(true).as("I am the first test").isTrue();
    }
}
like image 821
Lewis Ayers Avatar asked Nov 18 '25 12:11

Lewis Ayers


1 Answers

This issue is visible with 0.31.2 for TestNG project, See bug report.

Sorry that there's no workaround or solutions now but it would be fixed in next release.

like image 178
Molly Wang-MSFT Avatar answered Nov 21 '25 01:11

Molly Wang-MSFT