Make WordPress Core

Opened 7 years ago

Closed 4 years ago

Last modified 4 years ago

#40856 closed enhancement (fixed)

PHPUnit tests on Windows

Reported by: danielhuesken's profile danielhuesken Owned by: sergeybiryukov's profile 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 7 years ago.

Download all attachments as: .zip

Change History (11)

@danielhuesken
7 years ago

#1 @danielhuesken
7 years ago

  • Keywords has-patch added

#2 @netweb
7 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
7 years ago

  • Keywords reporter-feedback added

#4 @danielhuesken
7 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
4 years ago

  • Keywords needs-refresh added

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

#6 @SergeyBiryukov
4 years ago

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

#7 @SergeyBiryukov
4 years 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
4 years ago

  • Milestone changed from Future Release to 5.5

#9 @SergeyBiryukov
4 years 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.