Skip to content

Commit

Permalink
Remove the --warm-coverage-cache option cause by issue sebastianber…
Browse files Browse the repository at this point in the history
  • Loading branch information
kayw-geek committed Aug 5, 2024
1 parent 638f2d6 commit 969b081
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 120 deletions.
5 changes: 0 additions & 5 deletions src/TextUI/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
use PHPUnit\TextUI\Command\ShowHelpCommand;
use PHPUnit\TextUI\Command\ShowVersionCommand;
use PHPUnit\TextUI\Command\VersionCheckCommand;
use PHPUnit\TextUI\Command\WarmCodeCoverageCacheCommand;
use PHPUnit\TextUI\Configuration\CodeCoverageFilterRegistry;
use PHPUnit\TextUI\Configuration\Configuration;
use PHPUnit\TextUI\Configuration\PhpHandler;
Expand Down Expand Up @@ -472,10 +471,6 @@ private function executeCommandsThatDoNotRequireTheTestSuite(Configuration $conf
if ($cliConfiguration->listSuites()) {
$this->execute(new ListTestSuitesCommand($configuration->testSuite()));
}

if ($cliConfiguration->warmCoverageCache()) {
$this->execute(new WarmCodeCoverageCacheCommand($configuration, CodeCoverageFilterRegistry::instance()));
}
}

private function executeCommandsThatRequireTheTestSuite(Configuration $configuration, CliConfiguration $cliConfiguration, TestSuite $testSuite): void
Expand Down
81 changes: 0 additions & 81 deletions src/TextUI/Command/Commands/WarmCodeCoverageCacheCommand.php

This file was deleted.

8 changes: 0 additions & 8 deletions src/TextUI/Configuration/Cli/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ final class Builder
'colors==',
'columns=',
'configuration=',
'warm-coverage-cache',
'coverage-filter=',
'coverage-clover=',
'coverage-cobertura=',
Expand Down Expand Up @@ -175,7 +174,6 @@ public function fromParameters(array $parameters): Configuration
$colors = null;
$columns = null;
$configuration = null;
$warmCoverageCache = false;
$coverageFilter = null;
$coverageClover = null;
$coverageCobertura = null;
Expand Down Expand Up @@ -308,11 +306,6 @@ public function fromParameters(array $parameters): Configuration

break;

case '--warm-coverage-cache':
$warmCoverageCache = true;

break;

case '--coverage-clover':
$coverageClover = $option[1];

Expand Down Expand Up @@ -989,7 +982,6 @@ public function fromParameters(array $parameters): Configuration
$coverageTextShowOnlySummary,
$coverageXml,
$pathCoverage,
$warmCoverageCache,
$defaultTimeLimit,
$disableCodeCoverageIgnore,
$disallowTestOutput,
Expand Down
9 changes: 1 addition & 8 deletions src/TextUI/Configuration/Cli/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
private ?bool $coverageTextShowOnlySummary;
private ?string $coverageXml;
private ?bool $pathCoverage;
private bool $warmCoverageCache;
private ?int $defaultTimeLimit;
private ?bool $disableCodeCoverageIgnore;
private ?bool $disallowTestOutput;
Expand Down Expand Up @@ -165,7 +164,7 @@
* @param ?non-empty-list<non-empty-string> $coverageFilter
* @param ?non-empty-list<non-empty-string> $extensions
*/
public function __construct(array $arguments, ?string $atLeastVersion, ?bool $backupGlobals, ?bool $backupStaticProperties, ?bool $beStrictAboutChangesToGlobalState, ?string $bootstrap, ?string $cacheDirectory, ?bool $cacheResult, bool $checkVersion, ?string $colors, null|int|string $columns, ?string $configurationFile, ?string $coverageClover, ?string $coverageCobertura, ?string $coverageCrap4J, ?string $coverageHtml, ?string $coveragePhp, ?string $coverageText, ?bool $coverageTextShowUncoveredFiles, ?bool $coverageTextShowOnlySummary, ?string $coverageXml, ?bool $pathCoverage, bool $warmCoverageCache, ?int $defaultTimeLimit, ?bool $disableCodeCoverageIgnore, ?bool $disallowTestOutput, ?bool $enforceTimeLimit, ?array $excludeGroups, ?int $executionOrder, ?int $executionOrderDefects, ?bool $failOnDeprecation, ?bool $failOnEmptyTestSuite, ?bool $failOnIncomplete, ?bool $failOnNotice, ?bool $failOnRisky, ?bool $failOnSkipped, ?bool $failOnWarning, ?bool $stopOnDefect, ?bool $stopOnDeprecation, ?bool $stopOnError, ?bool $stopOnFailure, ?bool $stopOnIncomplete, ?bool $stopOnNotice, ?bool $stopOnRisky, ?bool $stopOnSkipped, ?bool $stopOnWarning, ?string $filter, ?string $excludeFilter, ?string $generateBaseline, ?string $useBaseline, bool $ignoreBaseline, bool $generateConfiguration, bool $migrateConfiguration, ?array $groups, ?array $testsCovering, ?array $testsUsing, bool $help, ?string $includePath, ?array $iniSettings, ?string $junitLogfile, bool $listGroups, bool $listSuites, bool $listTestFiles, bool $listTests, ?string $listTestsXml, ?bool $noCoverage, ?bool $noExtensions, ?bool $noOutput, ?bool $noProgress, ?bool $noResults, ?bool $noLogging, ?bool $processIsolation, ?int $randomOrderSeed, ?bool $reportUselessTests, ?bool $resolveDependencies, ?bool $reverseList, ?bool $stderr, ?bool $strictCoverage, ?string $teamcityLogfile, ?string $testdoxHtmlFile, ?string $testdoxTextFile, ?array $testSuffixes, ?string $testSuite, ?string $excludeTestSuite, bool $useDefaultConfiguration, ?bool $displayDetailsOnIncompleteTests, ?bool $displayDetailsOnSkippedTests, ?bool $displayDetailsOnTestsThatTriggerDeprecations, ?bool $displayDetailsOnTestsThatTriggerErrors, ?bool $displayDetailsOnTestsThatTriggerNotices, ?bool $displayDetailsOnTestsThatTriggerWarnings, bool $version, ?array $coverageFilter, ?string $logEventsText, ?string $logEventsVerboseText, ?bool $printerTeamCity, ?bool $testdoxPrinter, ?bool $testdoxPrinterSummary, bool $debug, ?array $extensions)
public function __construct(array $arguments, ?string $atLeastVersion, ?bool $backupGlobals, ?bool $backupStaticProperties, ?bool $beStrictAboutChangesToGlobalState, ?string $bootstrap, ?string $cacheDirectory, ?bool $cacheResult, bool $checkVersion, ?string $colors, null|int|string $columns, ?string $configurationFile, ?string $coverageClover, ?string $coverageCobertura, ?string $coverageCrap4J, ?string $coverageHtml, ?string $coveragePhp, ?string $coverageText, ?bool $coverageTextShowUncoveredFiles, ?bool $coverageTextShowOnlySummary, ?string $coverageXml, ?bool $pathCoverage, ?int $defaultTimeLimit, ?bool $disableCodeCoverageIgnore, ?bool $disallowTestOutput, ?bool $enforceTimeLimit, ?array $excludeGroups, ?int $executionOrder, ?int $executionOrderDefects, ?bool $failOnDeprecation, ?bool $failOnEmptyTestSuite, ?bool $failOnIncomplete, ?bool $failOnNotice, ?bool $failOnRisky, ?bool $failOnSkipped, ?bool $failOnWarning, ?bool $stopOnDefect, ?bool $stopOnDeprecation, ?bool $stopOnError, ?bool $stopOnFailure, ?bool $stopOnIncomplete, ?bool $stopOnNotice, ?bool $stopOnRisky, ?bool $stopOnSkipped, ?bool $stopOnWarning, ?string $filter, ?string $excludeFilter, ?string $generateBaseline, ?string $useBaseline, bool $ignoreBaseline, bool $generateConfiguration, bool $migrateConfiguration, ?array $groups, ?array $testsCovering, ?array $testsUsing, bool $help, ?string $includePath, ?array $iniSettings, ?string $junitLogfile, bool $listGroups, bool $listSuites, bool $listTestFiles, bool $listTests, ?string $listTestsXml, ?bool $noCoverage, ?bool $noExtensions, ?bool $noOutput, ?bool $noProgress, ?bool $noResults, ?bool $noLogging, ?bool $processIsolation, ?int $randomOrderSeed, ?bool $reportUselessTests, ?bool $resolveDependencies, ?bool $reverseList, ?bool $stderr, ?bool $strictCoverage, ?string $teamcityLogfile, ?string $testdoxHtmlFile, ?string $testdoxTextFile, ?array $testSuffixes, ?string $testSuite, ?string $excludeTestSuite, bool $useDefaultConfiguration, ?bool $displayDetailsOnIncompleteTests, ?bool $displayDetailsOnSkippedTests, ?bool $displayDetailsOnTestsThatTriggerDeprecations, ?bool $displayDetailsOnTestsThatTriggerErrors, ?bool $displayDetailsOnTestsThatTriggerNotices, ?bool $displayDetailsOnTestsThatTriggerWarnings, bool $version, ?array $coverageFilter, ?string $logEventsText, ?string $logEventsVerboseText, ?bool $printerTeamCity, ?bool $testdoxPrinter, ?bool $testdoxPrinterSummary, bool $debug, ?array $extensions)
{
$this->arguments = $arguments;
$this->atLeastVersion = $atLeastVersion;
Expand All @@ -190,7 +189,6 @@ public function __construct(array $arguments, ?string $atLeastVersion, ?bool $ba
$this->coverageTextShowOnlySummary = $coverageTextShowOnlySummary;
$this->coverageXml = $coverageXml;
$this->pathCoverage = $pathCoverage;
$this->warmCoverageCache = $warmCoverageCache;
$this->defaultTimeLimit = $defaultTimeLimit;
$this->disableCodeCoverageIgnore = $disableCodeCoverageIgnore;
$this->disallowTestOutput = $disallowTestOutput;
Expand Down Expand Up @@ -704,11 +702,6 @@ public function pathCoverage(): bool
return $this->pathCoverage;
}

public function warmCoverageCache(): bool
{
return $this->warmCoverageCache;
}

/**
* @phpstan-assert-if-true !null $this->defaultTimeLimit
*/
Expand Down
1 change: 0 additions & 1 deletion src/TextUI/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ private function elements(): array
['arg' => '--only-summary-for-coverage-text', 'desc' => 'Option for code coverage report in text format: only show summary'],
['arg' => '--show-uncovered-for-coverage-text', 'desc' => 'Option for code coverage report in text format: show uncovered files'],
['arg' => '--coverage-xml <dir>', 'desc' => 'Write code coverage report in XML format to directory'],
['arg' => '--warm-coverage-cache', 'desc' => 'Warm static analysis cache'],
['arg' => '--coverage-filter <dir>', 'desc' => 'Include <dir> in code coverage reporting'],
['arg' => '--path-coverage', 'desc' => 'Report path coverage in addition to line coverage'],
['arg' => '--disable-coverage-ignore', 'desc' => 'Disable metadata for ignoring code coverage'],
Expand Down
1 change: 0 additions & 1 deletion tests/end-to-end/_files/output-cli-help-color.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
format: show uncovered files
--coverage-xml <dir>  Write code coverage report in XML format
to directory
--warm-coverage-cache  Warm static analysis cache
--coverage-filter <dir>  Include <dir> in code coverage reporting
--path-coverage  Report path coverage in addition to line
coverage
Expand Down
1 change: 0 additions & 1 deletion tests/end-to-end/_files/output-cli-usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ Code Coverage:
--only-summary-for-coverage-text Option for code coverage report in text format: only show summary
--show-uncovered-for-coverage-text Option for code coverage report in text format: show uncovered files
--coverage-xml <dir> Write code coverage report in XML format to directory
--warm-coverage-cache Warm static analysis cache
--coverage-filter <dir> Include <dir> in code coverage reporting
--path-coverage Report path coverage in addition to line coverage
--disable-coverage-ignore Disable metadata for ignoring code coverage
Expand Down
15 changes: 0 additions & 15 deletions tests/unit/TextUI/Configuration/Cli/BuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,21 +195,6 @@ public function testConfigurationMayNotBeConfigured(): void
$configuration->configurationFile();
}

#[TestDox('--warm-coverage-cache')]
public function testWarmCoverageCache(): void
{
$configuration = (new Builder)->fromParameters(['--warm-coverage-cache']);

$this->assertTrue($configuration->warmCoverageCache());
}

public function testWarmCoverageCacheMayNotBeConfigured(): void
{
$configuration = (new Builder)->fromParameters([]);

$this->assertFalse($configuration->warmCoverageCache());
}

#[TestDox('--coverage-clover file')]
public function testCoverageClover(): void
{
Expand Down

0 comments on commit 969b081

Please sign in to comment.