Page MenuHomeDevCentral

Detect when test suite runs with privileged access
ClosedPublic

Authored by dereckson on Mar 11 2020, 14:42.
Tags
None
Referenced Files
F47313484: D2278.id5739.diff
Sun, Aug 30, 12:17
F47313480: D2278.id5738.diff
Sun, Aug 30, 12:17
F47313382: D2278.id5737.diff
Sun, Aug 30, 12:16
F47313380: D2278.id5741.diff
Sun, Aug 30, 12:16
F47313146: D2278.diff
Sun, Aug 30, 12:15
F47312731: D2278.id5740.diff
Sun, Aug 30, 12:12
F47283657: D2278.diff
Sun, Aug 30, 09:21
F47229712: D2278.id5741.diff
Sun, Aug 30, 03:55
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