Page MenuHomePhorge

Fix Diffusion commands in non-English environments
ClosedPublic

Authored by valerio.bozzolan on Dec 5 2024, 15:43.
Tags
None
Referenced Files
F3388025: D25846.1744443799.diff
Fri, Apr 11, 07:43
F3388019: D25846.1744443764.diff
Fri, Apr 11, 07:42
F3388018: D25846.1744443751.diff
Fri, Apr 11, 07:42
F3367245: D25846.1744195991.diff
Tue, Apr 8, 10:53
F3365735: D25846.1744177721.diff
Tue, Apr 8, 05:48
F3364637: D25846.1744158522.diff
Tue, Apr 8, 00:28
F3322289: D25846.1743368859.diff
Sat, Mar 29, 21:07
F3321730: D25846.1743359850.diff
Sat, Mar 29, 18:37

Details

Summary

Closes T15966

Force Diffusion commands to be executed in the "LC_ALL=C" language mode, that is, English,
defusing whatever custom language you have in your LANGUAGE variable.

Related reading:

https://we.phorge.it/T15872

Test Plan

Make sure Subversion is installed on your system. Explicitly set LC_ALL.
Finally, this unit test works, even if you have something esoteric in your LANGUAGE:

arc unit ./src/applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php

Before, it was crashing, like mentioned in T15966.

Diff Detail

Repository
rP Phorge
Branch
T15966-fix-unit-test
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1641
Build 1641: arc lint + arc unit

Event Timeline

aklapper subscribed.

After installing subversion and setting LC_ALL instead of LANG I can finally reproduce on a Fedora 40 system:

Before:

[acko@fedora phorge (master $|u=)]$ LC_ALL=fr_FR.utf8 ../arcanist/bin/arc unit ./src/applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php
   FAIL  PhabricatorChangeParserTestCase::testSubversionPartialParser
EXCEPTION (CommandException): Command failed with error #1!
COMMAND
svn --non-interactive log --xml --quiet --limit 4 file:///tmp/pfkja9lhp6o488kw/trunk/@2

STDOUT
<?xml version="1.0" encoding="UTF-8"?>
<log>


STDERR
svn: E160013: Fichier non trouvé : révision 2, chemin '/trunk'

#0 /var/www/html/phorge/arcanist/src/future/exec/ExecFuture.php(341): ExecFuture->raiseResultError(Array)
#1 /var/www/html/phorge/phorge/src/applications/repository/storage/PhabricatorRepository.php(495): ExecFuture->resolvex()
#2 /var/www/html/phorge/phorge/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php(256): PhabricatorRepository->execxRemoteCommand('...', 4, '...')
#3 /var/www/html/phorge/phorge/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php(71): PhabricatorRepositoryDiscoveryEngine->discoverSubversionCommits()
#4 /var/www/html/phorge/phorge/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php(53): PhabricatorRepositoryDiscoveryEngine->discoverCommitsWithLock()
#5 /var/www/html/phorge/phorge/src/applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php(971): PhabricatorRepositoryDiscoveryEngine->discoverCommits()
#6 /var/www/html/phorge/arcanist/src/unit/engine/phutil/PhutilTestCase.php(639): PhabricatorChangeParserTestCase->testSubversionPartialParser()
#7 /var/www/html/phorge/arcanist/src/unit/engine/PhutilUnitTestEngine.php(69): PhutilTestCase->run()
#8 /var/www/html/phorge/arcanist/src/unit/engine/ArcanistConfigurationDrivenUnitTestEngine.php(148): PhutilUnitTestEngine->run()
#9 /var/www/html/phorge/arcanist/src/workflow/ArcanistUnitWorkflow.php(170): ArcanistConfigurationDrivenUnitTestEngine->run()
#10 /var/www/html/phorge/arcanist/scripts/arcanist.php(427): ArcanistUnitWorkflow->run()
#11 {main}
   SKIP  PhabricatorChangeParserTestCase::testMercurialParser
No binary "hg" found on this system, skipping test.
   PASS  333ms   PhabricatorChangeParserTestCase::testSubversionForeignStubsParser
   PASS  668ms   PhabricatorChangeParserTestCase::testGitParser
   PASS  273ms   PhabricatorChangeParserTestCase::testSubversionValidRootParser
   PASS  941ms   PhabricatorChangeParserTestCase::testSubversionParser

COVERAGE REPORT
     76%     src/applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php

After:

[acko@fedora phorge (master $|u=)]$ LC_ALL=fr_FR.utf8 ../arcanist/bin/arc unit ./src/applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php
   PASS  828ms   PhabricatorChangeParserTestCase::testGitParser
   PASS  281ms   PhabricatorChangeParserTestCase::testSubversionValidRootParser
   PASS  929ms   PhabricatorChangeParserTestCase::testSubversionParser
   PASS  326ms   PhabricatorChangeParserTestCase::testSubversionForeignStubsParser
   SKIP  PhabricatorChangeParserTestCase::testMercurialParser
No binary "hg" found on this system, skipping test.
   PASS  260ms   PhabricatorChangeParserTestCase::testSubversionPartialParser

COVERAGE REPORT
     83%     src/applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php
This revision is now accepted and ready to land.Dec 10 2024, 09:52