[gha] Define COLUMNS properly

This reverts commit c2e4ac613c.
This commit is contained in:
Nicolas Grekas 2021-06-27 14:13:22 +02:00
parent fdb8b9e64c
commit 058168e2ed
6 changed files with 32 additions and 13 deletions

View File

@ -61,6 +61,7 @@ jobs:
COMPOSER_HOME="$(composer config home)"
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
echo COLUMNS=120 >> $GITHUB_ENV
echo PHPUNIT="$(readlink -f ./phpunit) --exclude-group tty,benchmark,intl-data" >> $GITHUB_ENV
echo COMPOSER_UP='composer update --no-progress --ansi' >> $GITHUB_ENV
@ -149,7 +150,6 @@ jobs:
local ok=0
local title="$1 $FLIP"
local start=$(date -u +%s)
export COLUMNS=120
OUTPUT=$(bash -xc "$2" 2>&1) || ok=1
local end=$(date -u +%s)

View File

@ -15,14 +15,17 @@ use Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor;
class TextDescriptorTest extends AbstractDescriptorTest
{
private $colSize;
protected function setUp(): void
{
putenv('COLUMNS=121');
$this->colSize = getenv('COLUMNS');
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
}
protected function tearDown(): void
{
putenv('COLUMNS');
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
}
protected function getDescriptor()

View File

@ -29,6 +29,18 @@ class UserPasswordEncoderCommandTest extends AbstractWebTestCase
{
/** @var CommandTester */
private $passwordEncoderCommandTester;
private $colSize;
protected function setUp(): void
{
$this->colSize = getenv('COLUMNS');
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
}
protected function tearDown(): void
{
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
}
public function testEncodePasswordEmptySalt()
{
@ -314,7 +326,6 @@ EOTXT
protected function setUp(): void
{
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
$kernel = $this->createKernel(['test_case' => 'PasswordEncode']);
$kernel->boot();
@ -332,7 +343,6 @@ EOTXT
private function setupArgon2i()
{
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
$kernel = $this->createKernel(['test_case' => 'PasswordEncode', 'root_config' => 'argon2i.yml']);
$kernel->boot();
@ -345,7 +355,6 @@ EOTXT
private function setupArgon2id()
{
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
$kernel = $this->createKernel(['test_case' => 'PasswordEncode', 'root_config' => 'argon2id.yml']);
$kernel->boot();
@ -358,7 +367,6 @@ EOTXT
private function setupBcrypt()
{
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
$kernel = $this->createKernel(['test_case' => 'PasswordEncode', 'root_config' => 'bcrypt.yml']);
$kernel->boot();
@ -371,7 +379,6 @@ EOTXT
private function setupSodium()
{
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
$kernel = $this->createKernel(['test_case' => 'PasswordEncode', 'root_config' => 'sodium.yml']);
$kernel->boot();

View File

@ -15,14 +15,17 @@ use Symfony\Component\Form\Console\Descriptor\JsonDescriptor;
class JsonDescriptorTest extends AbstractDescriptorTest
{
private $colSize;
protected function setUp(): void
{
putenv('COLUMNS=121');
$this->colSize = getenv('COLUMNS');
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
}
protected function tearDown(): void
{
putenv('COLUMNS');
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
}
protected function getDescriptor()

View File

@ -15,14 +15,17 @@ use Symfony\Component\Form\Console\Descriptor\TextDescriptor;
class TextDescriptorTest extends AbstractDescriptorTest
{
private $colSize;
protected function setUp(): void
{
putenv('COLUMNS=121');
$this->colSize = getenv('COLUMNS');
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
}
protected function tearDown(): void
{
putenv('COLUMNS');
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
}
protected function getDescriptor()

View File

@ -27,14 +27,17 @@ use Symfony\Component\Messenger\Tests\Fixtures\MultipleBusesMessageHandler;
*/
class DebugCommandTest extends TestCase
{
private $colSize;
protected function setUp(): void
{
$this->colSize = getenv('COLUMNS');
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
}
protected function tearDown(): void
{
putenv('COLUMNS');
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
}
public function testOutput()