Skip to content

Organize Zend/tests/*.phpt tests into subdirectories for easier navigation #15631

Description

@DanielEScherzer

Description

I wanted to take a look at any of the enum-related tests, but on GitHub navigating to https://github.com/php/php-src/tree/master/Zend/tests shows

Sorry, we had to truncate this directory to 1,000 files. 1,534 entries were omitted from the list. Latest commit info may be omitted.

I propose that the tests that are directly in the top-level Zend/tests/*.phpt be organized a bit with sub directories so that they can be navigated more easily, both on GitHub and in downloaded copies of PHP. For an easy example, there are 21 different tests for creating class aliases, class_alias_001.phpt through class_alias_021.phpt - these could be grouped together in their own directory (probably just named class_alias).

I'm happy to send the patches to work on this reorganization if there is buy-in, but figured I should ask before I started the work. Since this doesn't affect the actual execution of PHP I didn't think it was applicable to propose on the internals list, so adding it here.

PS: this is tagged as a feature but only because that was the most applicable of the GitHub issue forms, but it isn't really a feature

Activity

  1. iluuu1994 commented on Aug 29, 2024

    @iluuu1994
    Member

    Hi @DanielEScherzer. That will be a pain in the butt when merging bug fixes upward. Not sure I'd be in favor.

  2. DanielEScherzer commented on Aug 29, 2024

    @DanielEScherzer
    MemberAuthor

    Hi @DanielEScherzer. That will be a pain in the butt when merging bug fixes upward.

    I hadn't thought about that. But, looking through all 8.2 commits since the start of the month, I only count 6 commits that modify or delete existing test files (rather than adding new files, which shouldn't cause problems) and all 6 are for extensions (7878a2c, 1b52ecd, 4d71580, 2829065, 6713d51, 11fbe88). In fact, I had to go all the way back to your May 6 commit f8d1864 to find an 8.2 commit that affected existing Zend test files, and the most recent for 8.3 that I could find was also from you that day, 5aa5080

    My understanding from looking through the git history is that normally bug fixes only result in adding new tests, since changing existing tests suggests that the fix also modifies some stable behavior?

  3. iluuu1994 commented on Aug 29, 2024

    @iluuu1994
    Member

    rather than adding new files, which shouldn't cause problems

    Not problems, per-se. But if the idea is to split the tests, then they probably no longer belong in root and will have to be moved again.

  4. DanielEScherzer commented on Aug 29, 2024

    @DanielEScherzer
    MemberAuthor

    rather than adding new files, which shouldn't cause problems

    Not problems, per-se. But if the idea is to split the tests, then they probably no longer belong in root and will have to be moved again.

    My proposal was just to split the tests enough to be navigable on GitHub, I'm not suggesting to create a strict hierarchy - we would still most likely end up with a bunch of tests in the top level. How about I send a demo patch to show what I'm thinking?

  5. cmb69 commented on Aug 29, 2024

    @cmb69
    Member

    Modifying the directory structure is always a bit of an issue, not only for merging, but also for git log and git blame etc. However, if we have proper git renames, it's probably not that bad.

    Maybe we should start moving all bug*.phpt and bug* directories to a bug/ directory, and do the same for gh*. Especially the former would reduce the number of toplevel dirents considerably. And if occassionally a file is not moved into the right directory when merging up, that's not a big deal anyway.

  6. DanielEScherzer commented on Aug 29, 2024

    @DanielEScherzer
    MemberAuthor

    Just wanting to note that there is https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view to allow ignoring some commits via git blame, that might satisfy the concerns

    I sent #15638 as a demonstration of what I was thinking - while I agree that having a top-level bug/ would probably help, that is a case where there might be more conflicts merging up, so I didn't want to start there

  7. 25 remaining items

  8. DanielEScherzer commented on Jun 29, 2026

    @DanielEScherzer
    MemberAuthor

    Looks like I should come back to this, "Sorry, we had to truncate this directory to 1,000 files. 6 entries were omitted from the list. Latest commit info may be omitted."

  9. DanielEScherzer commented on Jul 14, 2026

    @DanielEScherzer
    MemberAuthor

    Between 8.1.0 and the current 8.1 branch (which shouldn't be changed again, security support is over) 75 tests were added
    From 8.2.0 through current 8.2: +114
    From 8.3.0 through current 8.3: +97
    From 8.4.1 through current 8.4: +56
    From 8.5.0 through current 8.5: +19 (currently at 995 :()
    So hopefully #22731 will be enough so that it isn't an issue for the life of 8.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions