Page MenuHomeDevCentral

Detect when test suite runs with privileged access
ClosedPublic

Authored by dereckson on Mar 11 2020, 14:42.
Tags
None
Referenced Files
F28410034: D2278.id5740.diff
Tue, May 12, 04:54
Unknown Object (File)
Mon, May 11, 19:52
Unknown Object (File)
Mon, May 11, 17:13
Unknown Object (File)
Sat, May 9, 14:51
Unknown Object (File)
Sat, May 9, 06:05
Unknown Object (File)
Sat, May 9, 03:37
Unknown Object (File)
Sat, May 9, 02:25
Unknown Object (File)
Sat, May 9, 01:14
Subscribers
None

Details

Summary

When the test suite runs as root under Linux or FreeBSD,
or with elevated status ('runs as administrator') on Windows,
the process can see normally non-readable files.

As such, we skip the relevant tests.

Test Plan
  • Windows: runs in a regular console and a privileged console
  • Debian: runs as root, and with sudo -u nobody phpunit
  • FreeBSD: runs trim(shell_exec('id -u')) with psysh

Diff Detail

Repository
rKOT Keruald OmniTools
Lint
Lint Errors
SeverityLocationCodeMessage
Errortests/Reflection/CodeFileTest.php:40PHPCS.E.Generic.WhiteSpace.DisallowTabIndent.TabsUsedGeneric.WhiteSpace.DisallowTabIndent.TabsUsed
Errortests/Reflection/CodeFileTest.php:65PHPCS.E.Generic.WhiteSpace.DisallowTabIndent.TabsUsedGeneric.WhiteSpace.DisallowTabIndent.TabsUsed
Unit
Tests Passed
Branch
master
Build Status
Buildable 3537
Build 3786: arc lint + arc unit