Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ PHPUnit ] Skipped tests marked as passed in the Test Results window #7739

Closed
SolracLeinad opened this issue Sep 7, 2024 · 1 comment
Closed
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers PHP [ci] enable extra PHP tests (php/php.editor)

Comments

@SolracLeinad
Copy link

SolracLeinad commented Sep 7, 2024

Apache NetBeans version

Apache NetBeans 22

What happened

Whether a test is skipped because of annotations or because a dependency failed it will be marked as passed (it should be marked as skipped). There is no mention of the number of skipped tests anywhere and the "show skipped" button does nothing.

The output window does show the results of the tests correctly and the nb-phpunit-log.xml file does contain information about the skipped tests.

Language / Project Type / NetBeans Component

PHPUnit

How to reproduce

Just run this simple test:

use PHPUnit\Framework\TestCase;

/**
 * Description of testTest
 *
 */
class testTest extends TestCase {

    /**
     * @test
     */
    function testA() {
        self::assertEquals(1, 1);
        return true;
    }


    /**
     * @test
     * @depends testA
     */
    function testA2($varFromTestA) {
        self::assertEquals($varFromTestA, 1);
    }

    /**
     * @test
     */
    function testAB() {
        self::assertEquals(1, 1);
        throw new Exception('This test fails');
    }

    /**
     * @test
     * @depends testAB
     */
    function testAB2($varFromTestA) {
        self::assertEquals($varFromTestA, 1);
    }

    /**
     * @test
     * @depends testAB
     */
    function testAB3($varFromTestA) {
        self::assertEquals($varFromTestA, 1);
    }

    /**
     * @test
     * @skip
     */
    function testSkipped() {
        self::markTestSkipped('Manually skipped');
        self::assertEquals(1, 1);
    }
}

As you can see, you will find every skipped test passed:
imagen

Did this work correctly in an earlier version?

No / Don't know

Operating System

Debian 12

JDK

OpenJDK Runtime Environment 17.0.12+7-Debian-2deb12u1

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

This is the output of the "Output window" which shows both tests skipped due errors and the one manually skipped:

PHPUnit 9.6.20 by Sebastian Bergmann and contributors.

..ESSS                                                              6 / 6 (100%)

Time: 00:00.002, Memory: 12.88 MB

There was 1 error:

1) testTest::testAB
Exception: This test fails

/home/****/NetBeansProjects/****/.tests/testTest.php:33

ERRORS!
Tests: 6, Assertions: 3, Errors: 1, Skipped: 3.
Done.

Are you willing to submit a pull request?

No

@SolracLeinad SolracLeinad added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Sep 7, 2024
@troizet troizet added the PHP [ci] enable extra PHP tests (php/php.editor) label Sep 8, 2024
troizet added a commit to troizet/netbeans that referenced this issue Oct 7, 2024
troizet added a commit to troizet/netbeans that referenced this issue Oct 8, 2024
troizet added a commit to troizet/netbeans that referenced this issue Oct 8, 2024
@troizet
Copy link
Collaborator

troizet commented Oct 9, 2024

Fixed in #7836.

@troizet troizet closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

No branches or pull requests

2 participants