Page MenuHomeDevCentral

Detect when test suite runs with privileged access
ClosedPublic

Authored by dereckson on Mar 11 2020, 14:42.
Tags
None
Referenced Files
F53775473: D2278.id5741.diff
Mon, Oct 12, 05:17
F53762891: D2278.id5738.diff
Mon, Oct 12, 03:15
F53762886: D2278.id5739.diff
Mon, Oct 12, 03:15
F53762848: D2278.id5740.diff
Mon, Oct 12, 03:15
F53756958: D2278.diff
Mon, Oct 12, 02:10
F53740959: D2278.id5740.diff
Sun, Oct 11, 22:58
F53737856: D2278.id.diff
Sun, Oct 11, 22:22
F53704825: D2278.id5737.diff
Sun, Oct 11, 16:40
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