Page MenuHomeDevCentral

Detect when test suite runs with privileged access
ClosedPublic

Authored by dereckson on Mar 11 2020, 14:42.
Tags
None
Referenced Files
F27914148: D2278.id5738.diff
Sat, May 9, 01:14
F27912163: D2278.id5740.diff
Sat, May 9, 00:54
F27912145: D2278.id5737.diff
Sat, May 9, 00:54
F27912141: D2278.id5739.diff
Sat, May 9, 00:54
F27890974: D2278.id5739.diff
Fri, May 8, 21:47
F27890895: D2278.id5738.diff
Fri, May 8, 21:46
F27890851: D2278.id5737.diff
Fri, May 8, 21:46
Unknown Object (File)
Wed, May 6, 15:28
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