WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 6 months ago

Last modified 6 months ago

#40856 closed enhancement (fixed)

PHPUnit tests on Windows

Reported by: danielhuesken Owned by: SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: normal Version: 4.8
Component: Build/Test Tools Keywords: has-patch needs-refresh
Focuses: Cc:

Description

We can get more PHP unit tests work under windows system if files wil not created in /temp and symlinks will not be used.

Attachments (1)

40856.patch (5.8 KB) - added by danielhuesken 4 years ago.

Download all attachments as: .zip

Change History (11)

@danielhuesken
4 years ago

#1 @danielhuesken
4 years ago

  • Keywords has-patch added

#2 @netweb
4 years ago

Related, possible duplicate of #39975

The patch in #39975 appears to cover a few more instances of /tmp usage in the codebase.

@danielhuesken The [symlink https://secure.php.net/manual/en/function.symlink.php] function is avialble on Windows with PHP 5.3 or greater, can I ask what issues you're having with symlink on Windows?

#3 @netweb
4 years ago

  • Keywords reporter-feedback added

#4 @danielhuesken
4 years ago

  • Keywords reporter-feedback removed

@netweb Yes, there are supported but with limitations minimum Windows Version is Windows Vista or Server 2008 and you must use NTFS File System.

I use Windows 10 with NTFS (Apache, PHP 7.1) and they will not work. There error message is "Warning: symlink(): Cannot create symlink, error code(1314)" it should be Permission related. See https://bugs.php.net/bug.php?id=54141.

I think that are many things you must know to run test on windows correctly.

#5 @davidbaumwald
6 months ago

  • Keywords needs-refresh added

Latest patch fails against trunk, so marking for a refresh.

#6 @SergeyBiryukov
6 months ago

  • Milestone changed from Awaiting Review to Future Release
  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

#7 @SergeyBiryukov
6 months ago

In 48463:

Tests: Copy themes from tests/phpunit/data to wp-content/themes, instead of creating a symlink.

This allows the theme file tests in phpunit/tests/link/themeFile.php to run on Windows without requiring administrative privileges.

Follow-up to [42812], [42819].

Props danielhuesken, christophherr, davidbaumwald, SergeyBiryukov.
See #40856, #39975.

#8 @SergeyBiryukov
6 months ago

  • Milestone changed from Future Release to 5.5

#9 @SergeyBiryukov
6 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 48464:

Tests: Replace hardcoded /tmp/ references with get_temp_dir().

This allows more tests to pass on Windows.

Props danielhuesken, DJPaul, christophherr, joemcgill, netweb, davidbaumwald, SergeyBiryukov.
Fixes #40856, #39975.

Note: See TracTickets for help on using tickets.