Skip to content

Commit 9dfcefb

Browse files
committed
MQE-1582: Enable Testers To Run Skipped Tests
- Unit/Static check fixes
1 parent b27e2a9 commit 9dfcefb

File tree

7 files changed

+22
-31
lines changed

7 files changed

+22
-31
lines changed

dev/tests/_bootstrap.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
true,
3333
\Magento\FunctionalTestingFramework\Config\MftfApplicationConfig::UNIT_TEST_PHASE,
3434
true,
35-
\Magento\FunctionalTestingFramework\Config\MftfApplicationConfig::LEVEL_NONE
35+
\Magento\FunctionalTestingFramework\Config\MftfApplicationConfig::LEVEL_NONE,
36+
false
3637
);
3738

3839
// Load needed framework env params

src/Magento/FunctionalTestingFramework/Config/MftfApplicationConfig.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class MftfApplicationConfig
5555

5656
/**
5757
* Boolean which allows MFTF to fully generate skipped tests
58-
* @var bool
58+
* @var boolean
5959
*/
6060
private $allowSkipped;
6161

@@ -108,9 +108,9 @@ private function __construct(
108108
* returns void and is only run once during the lifetime of the application.
109109
*
110110
* @param boolean $forceGenerate
111-
* @param string $phase
111+
* @param string $phase
112112
* @param boolean $verboseEnabled
113-
* @param string $debugLevel
113+
* @param string $debugLevel
114114
* @param boolean $allowSkipped
115115
* @return void
116116
* @throws TestFrameworkException

src/Magento/FunctionalTestingFramework/Console/BaseGenerateCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ protected function configure()
3838
'a',
3939
InputOption::VALUE_NONE,
4040
'Allows MFTF to generate and run skipped tests.'
41+
)->addOption(
42+
'debug',
43+
'd',
44+
InputOption::VALUE_OPTIONAL,
45+
'Run extra validation when running tests. Use option \'none\' to turn off debugging --
46+
added for backward compatibility, will be removed in the next MAJOR release',
47+
MftfApplicationConfig::LEVEL_DEFAULT
4148
);
4249
}
4350

src/Magento/FunctionalTestingFramework/Console/GenerateTestsCommand.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ protected function configure()
4646
't',
4747
InputOption::VALUE_REQUIRED,
4848
'A parameter accepting a JSON string used to determine the test configuration'
49-
)->addOption(
50-
'debug',
51-
'd',
52-
InputOption::VALUE_OPTIONAL,
53-
'Run extra validation when generating tests. Use option \'none\' to turn off debugging --
54-
added for backward compatibility, will be removed in the next MAJOR release',
55-
MftfApplicationConfig::LEVEL_DEFAULT
5649
);
5750

5851
parent::configure();
@@ -129,8 +122,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
129122
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
130123
* @throws \Magento\FunctionalTestingFramework\Exceptions\XmlException
131124
*/
132-
private function createTestConfiguration($json, array $tests, bool $force, $debug, bool $verbose, bool $allowSkipped)
133-
{
125+
private function createTestConfiguration(
126+
$json,
127+
array $tests,
128+
bool $force,
129+
$debug,
130+
bool $verbose,
131+
bool $allowSkipped
132+
) {
134133
// set our application configuration so we can references the user options in our framework
135134
MftfApplicationConfig::create(
136135
$force,

src/Magento/FunctionalTestingFramework/Console/RunTestCommand.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,7 @@ protected function configure()
3131
'name',
3232
InputArgument::REQUIRED | InputArgument::IS_ARRAY,
3333
"name of tests to generate and execute"
34-
)->addOption('skip-generate', 'k', InputOption::VALUE_NONE, "skip generation and execute existing test")
35-
->addOption(
36-
'debug',
37-
'd',
38-
InputOption::VALUE_OPTIONAL,
39-
'Run extra validation when running tests. Use option \'none\' to turn off debugging --
40-
added for backward compatibility, will be removed in the next MAJOR release',
41-
MftfApplicationConfig::LEVEL_DEFAULT
42-
);
34+
)->addOption('skip-generate', 'k', InputOption::VALUE_NONE, "skip generation and execute existing test");
4335

4436
parent::configure();
4537
}
@@ -63,7 +55,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6355
$debug = $input->getOption('debug') ?? MftfApplicationConfig::LEVEL_DEVELOPER; // for backward compatibility
6456
$allowSkipped = $input->getOption('allowSkipped');
6557

66-
6758
if ($skipGeneration and $remove) {
6859
// "skip-generate" and "remove" options cannot be used at the same time
6960
throw new TestFrameworkException(

src/Magento/FunctionalTestingFramework/Console/RunTestGroupCommand.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ protected function configure()
3434
'k',
3535
InputOption::VALUE_NONE,
3636
"only execute a group of tests without generating from source xml"
37-
)->addOption(
38-
'debug',
39-
'd',
40-
InputOption::VALUE_OPTIONAL,
41-
'Run extra validation when running tests. Use option \'none\' to turn off debugging --
42-
added for backward compatibility, will be removed in the next MAJOR release',
43-
MftfApplicationConfig::LEVEL_DEFAULT
4437
)->addArgument(
4538
'groups',
4639
InputArgument::IS_ARRAY | InputArgument::REQUIRED,

src/Magento/FunctionalTestingFramework/DataGenerator/Objects/EntityDataObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function getDataByName($name, $uniquenessFormat)
206206
}
207207
return $this->formatUniqueData($name_lower, $uniquenessData, $uniquenessFormat);
208208
} elseif (array_key_exists($name, $this->data)) {
209-
if (is_array($this->data[$name_lower])) {
209+
if (is_array($this->data[$name])) {
210210
return $this->data[$name];
211211
}
212212
$this->data[$name] = $dataReferenceResolver->getDataReference(

0 commit comments

Comments
 (0)