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

A test file can affect a test in which it is not used. #6066

Closed
troizet opened this issue Jun 10, 2023 · 1 comment
Closed

A test file can affect a test in which it is not used. #6066

troizet opened this issue Jun 10, 2023 · 1 comment
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers tests

Comments

@troizet
Copy link
Collaborator

troizet commented Jun 10, 2023

Apache NetBeans version

Apache NetBeans 18

What happened

A test file can affect a test in which it is not used.

How to reproduce

  • create a test file named testFailureTesting.php in the directory
    php/php.editor/test/unit/data/testfiles/completion/documentation/

  • copy the contents of the test file php/php.editor/test/unit/data/testfiles/completion/documentation/arrayReturnType.php into the newly created file

  • run testArrayReturnType in php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCCDocumentationTest.java

  • We will get a failed test for a reason:

Actual content contains following lines which are missing in expected content: 
	------------------------------------
	METHOD     functionName()                  [PUBLIC]   testFailureTesting.php
Expected content contains following lines which are missing in actual content: 
	METHOD     functionName()                  [PUBLIC]   arrayReturnType.php

although testFailureTesting.php has nothing to do with this test.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Ubuntu 22.04.2 LTS

JDK

OpenJDK Runtime Environment 11.0.19+7-post-Ubuntu-0ubuntu122.04.1

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

It seems that the test execution indexes test files that are not related to the test being executed.

Are you willing to submit a pull request?

No

@troizet troizet added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Jun 10, 2023
@troizet troizet changed the title PHP: A test file can affect a test in which it is not used. A test file can affect a test in which it is not used. Jun 10, 2023
@mbien mbien added the tests label Jun 10, 2023
@junichi11
Copy link
Member

junichi11 commented Jul 8, 2024

Not a bug. Please use another function name.
The class path is /testfiles/completion/documentation.
Both functionName() is valid in it.

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 tests
Projects
None yet
Development

No branches or pull requests

3 participants