Skip to content

Commit bd2eee2

Browse files
authored
MQE-2164: Remove terms from MFTF (magento#739)
1 parent 7a7e403 commit bd2eee2

File tree

18 files changed

+60
-128
lines changed

18 files changed

+60
-128
lines changed

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ Magento Functional Testing Framework Changelog
177177
* Command verifies and troubleshoots some configuration steps required for running tests
178178
* Please see DevDocs for more details
179179
* `<*Data>` actions now contain `API Endpoint` and `Request Header` artifacts.
180-
* Introduced new `.env` configurations `ENABLE_BROWSER_LOG` and `BROWSER_LOG_BLACKLIST`
180+
* Introduced new `.env` configurations `ENABLE_BROWSER_LOG` and `BROWSER_LOG_BLOCKLIST`
181181
* Configuration enables allure artifacts for browser log entries if they are present after the step.
182-
* Blacklist filters out logs from specific sources.
182+
* Blocklist filters out logs from specific sources.
183183
* Customizability
184184
* Introduced `timeout=""` to `magentoCLI` actions.
185185

bin/blacklist.txt renamed to bin/blocklist.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# #
44
# THIS FILE CANNOT CONTAIN BLANK LINES #
55
###################################################################
6-
bin/blacklist.txt
6+
bin/blocklist.txt
77
dev/tests/static/Magento/Sniffs/Commenting/FunctionCommentSniff.php
88
dev/tests/static/Magento/Sniffs/Commenting/VariableCommentSniff.php
99
dev/tests/verification/_generated

bin/copyright-check

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66

77
FILE_EXTENSIONS='.php\|.xml\|.xsd'
8-
BLACKLIST='bin/blacklist.txt'
8+
BLOCKLIST='bin/blocklist.txt'
99
RESULT=''
1010

1111
# Iterate through the list of tracked files
1212
# that have the expected extensions
1313
# that are not ignored
14-
for i in `git ls-tree --full-tree -r --name-only HEAD | grep $FILE_EXTENSIONS | grep -v -f $BLACKLIST`
14+
for i in `git ls-tree --full-tree -r --name-only HEAD | grep $FILE_EXTENSIONS | grep -v -f $BLOCKLIST`
1515
do
1616
if echo `cat $i` | grep -q -v "Copyright © Magento, Inc. All rights reserved."; then
1717
# Copyright is missing

bin/copyright-check.bat

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
@echo off
55
SETLOCAL EnableDelayedExpansion
6-
SET BLACKLIST_FILE=bin/blacklist.txt
6+
SET BLOCKLIST_FILE=bin/blocklist.txt
77
SET i=0
88

99
FOR /F %%x IN ('git ls-tree --full-tree -r --name-only HEAD') DO (
@@ -12,14 +12,14 @@ FOR /F %%x IN ('git ls-tree --full-tree -r --name-only HEAD') DO (
1212
if "%%~xx"==".xml" set GOOD_EXT=1
1313
if "%%~xx"==".xsd" set GOOD_EXT=1
1414
IF DEFINED GOOD_EXT (
15-
SET BLACKLISTED=
16-
FOR /F "tokens=* skip=5" %%f IN (%BLACKLIST_FILE%) DO (
15+
SET BLOCKLISTED=
16+
FOR /F "tokens=* skip=5" %%f IN (%BLOCKLIST_FILE%) DO (
1717
SET LINE=%%x
1818
IF NOT "!LINE!"=="!LINE:%%f=!" (
19-
SET BLACKLISTED=1
19+
SET BLOCKLISTED=1
2020
)
2121
)
22-
IF NOT DEFINED BLACKLISTED (
22+
IF NOT DEFINED BLOCKLISTED (
2323
FIND "Copyright © Magento, Inc. All rights reserved." %%x >nul
2424
IF ERRORLEVEL 1 (
2525
SET /A i+=1

dev/tests/_bootstrap.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
putenv("{$key}=${value}");
5555
}
5656

57-
// Add our test module to the whitelist
58-
putenv('MODULE_WHITELIST=Magento_TestModule');
57+
// Add our test module to the allowlist
58+
putenv('MODULE_ALLOWLIST=Magento_TestModule');
5959

6060
// Define our own set of paths for the tests
6161
defined('FW_BP') || define('FW_BP', PROJECT_ROOT);

dev/tests/static/Magento/Sniffs/MicroOptimizations/IsNullSniff.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class IsNullSniff implements Sniff
1313
/**
1414
* @var string
1515
*/
16-
protected $blacklist = 'is_null';
16+
protected $blocklist = 'is_null';
1717

1818
/**
1919
* @inheritdoc
@@ -29,7 +29,7 @@ public function register()
2929
public function process(File $sourceFile, $stackPtr)
3030
{
3131
$tokens = $sourceFile->getTokens();
32-
if ($tokens[$stackPtr]['content'] === $this->blacklist) {
32+
if ($tokens[$stackPtr]['content'] === $this->blocklist) {
3333
$sourceFile->addError(
3434
"is_null must be avoided. Use strict comparison instead.",
3535
$stackPtr,

dev/tests/unit/Magento/FunctionalTestFramework/Util/ModuleResolverTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -705,12 +705,12 @@ public function testApplyCustomModuleMethods()
705705
}
706706

707707
/**
708-
* Validate blacklisted modules are removed
708+
* Validate blocklisted modules are removed
709709
* Module paths are sorted according to module name in alphabetically ascending order
710710
*
711711
* @throws \Exception
712712
*/
713-
public function testGetModulePathsBlacklist()
713+
public function testGetModulePathsBlocklist()
714714
{
715715
$this->setMockResolverClass(
716716
false,
@@ -946,10 +946,10 @@ private function setMockResolverClass(
946946
* @param ModuleResolver $instance
947947
* @param array $mockPaths
948948
* @param array $mockModules
949-
* @param array $mockBlacklist
949+
* @param array $mockBlocklist
950950
* @throws \Exception
951951
*/
952-
private function setMockResolverProperties($instance, $mockPaths = null, $mockModules = null, $mockBlacklist = [])
952+
private function setMockResolverProperties($instance, $mockPaths = null, $mockModules = null, $mockBlocklist = [])
953953
{
954954
$property = new \ReflectionProperty(ModuleResolver::class, 'enabledModulePaths');
955955
$property->setAccessible(true);
@@ -959,9 +959,9 @@ private function setMockResolverProperties($instance, $mockPaths = null, $mockMo
959959
$property->setAccessible(true);
960960
$property->setValue($instance, $mockModules);
961961

962-
$property = new \ReflectionProperty(ModuleResolver::class, 'moduleBlacklist');
962+
$property = new \ReflectionProperty(ModuleResolver::class, 'moduleBlocklist');
963963
$property->setAccessible(true);
964-
$property->setValue($instance, $mockBlacklist);
964+
$property->setValue($instance, $mockBlocklist);
965965
}
966966

967967
/**

dev/tests/unit/Magento/FunctionalTestFramework/Util/Validation/NameValidationUtilTest.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,47 +17,47 @@ class NameValidationUtilTest extends MagentoTestCase
1717
*/
1818
public function testCurlyBracesInTestName()
1919
{
20-
$this->validateBlacklistedTestName("{{curlyBraces}}");
20+
$this->validateBlocklistedTestName("{{curlyBraces}}");
2121
}
2222

2323
/**
2424
* Validate name with quotation marks throws exception
2525
*/
2626
public function testQuotesInTestName()
2727
{
28-
$this->validateBlacklistedTestName("\"quotes\"");
28+
$this->validateBlocklistedTestName("\"quotes\"");
2929
}
3030

3131
/**
3232
* Validate name with single quotes throws exception
3333
*/
3434
public function testSingleQuotesInTestName()
3535
{
36-
$this->validateBlacklistedTestName("'singleQuotes'");
36+
$this->validateBlocklistedTestName("'singleQuotes'");
3737
}
3838

3939
/**
4040
* Validate name with parenthesis throws execption
4141
*/
4242
public function testParenthesesInTestName()
4343
{
44-
$this->validateBlacklistedTestName("(parenthesis)");
44+
$this->validateBlocklistedTestName("(parenthesis)");
4545
}
4646

4747
/**
4848
* Validate name with dollar signs throws exception
4949
*/
5050
public function testDollarSignInTestName()
5151
{
52-
$this->validateBlacklistedTestName("\$dollarSign\$");
52+
$this->validateBlocklistedTestName("\$dollarSign\$");
5353
}
5454

5555
/**
5656
* Validate name with spaces throws exception
5757
*/
5858
public function testSpacesInTestName()
5959
{
60-
$this->validateBlacklistedTestName("Test Name With Spaces");
60+
$this->validateBlocklistedTestName("Test Name With Spaces");
6161
}
6262

6363
/**
@@ -66,7 +66,7 @@ public function testSpacesInTestName()
6666
* @param string $testName
6767
* @return void
6868
*/
69-
private function validateBlacklistedTestName($testName)
69+
private function validateBlocklistedTestName($testName)
7070
{
7171
$this->expectException(XmlException::class);
7272
NameValidationUtil::validateName($testName, "Test");

docs/configuration.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,15 @@ Example:
214214
TESTS_MODULE_PATH=~/magento2/dev/tests/acceptance/tests/functional/Magento/FunctionalTest
215215
```
216216

217-
### MODULE_WHITELIST
217+
### MODULE_ALLOWLIST
218218

219219
Use for a new module.
220-
When adding a new directory at `Magento/FunctionalTest`, add the directory name to `MODULE_WHITELIST` to enable the MFTF to process it.
220+
When adding a new directory at `Magento/FunctionalTest`, add the directory name to `MODULE_ALLOWLIST` to enable the MFTF to process it.
221221

222222
Example:
223223

224224
```conf
225-
MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_ConfigurableProductCatalogSearch
225+
MODULE_ALLOWLIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_ConfigurableProductCatalogSearch
226226
```
227227

228228
### MAGENTO_CLI_COMMAND_PATH
@@ -331,14 +331,14 @@ Use this if you're having issues with sessions hanging in an MFTF suite.
331331
SELENIUM_CLOSE_ALL_SESSIONS=true
332332
```
333333

334-
### BROWSER_LOG_BLACKLIST
334+
### BROWSER_LOG_BLOCKLIST
335335

336-
Blacklists types of browser log entries from appearing in Allure steps.
336+
Blocklists types of browser log entries from appearing in Allure steps.
337337

338338
Denoted in browser log entry as `"SOURCE": "type"`.
339339

340340
```conf
341-
BROWSER_LOG_BLACKLIST=other,console-api
341+
BROWSER_LOG_BLOCKLIST=other,console-api
342342
```
343343

344344
### WAIT_TIMEOUT

etc/codecoverage/index.php

-58
This file was deleted.

etc/codecoverage/test.php

-10
This file was deleted.

etc/config/.env.example

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ BROWSER=chrome
4848
#DEFAULT_TIMEZONE=America/Los_Angeles
4949

5050
#*** These properties impact the modules loaded into MFTF, you can point to your own full path, or a custom set of modules located with the core set
51-
MODULE_WHITELIST=Magento_Framework,ConfigurableProductWishlist,ConfigurableProductCatalogSearch
51+
MODULE_ALLOWLIST=Magento_Framework,ConfigurableProductWishlist,ConfigurableProductCatalogSearch
5252
#CUSTOM_MODULE_PATHS=
5353

5454
#*** Bool property which allows the user to toggle debug output during test execution
@@ -63,9 +63,9 @@ MODULE_WHITELIST=Magento_Framework,ConfigurableProductWishlist,ConfigurableProdu
6363
#*** Uncomment and set to enable all tests, regardless of passing status, to have all their Allure artifacts.
6464
#VERBOSE_ARTIFACTS=true
6565

66-
#*** Uncomment and set to enable browser log entries on actions in Allure. Blacklist is used to filter logs of a specific "source"
66+
#*** Uncomment and set to enable browser log entries on actions in Allure. Blocklist is used to filter logs of a specific "source"
6767
#ENABLE_BROWSER_LOG=true
68-
#BROWSER_LOG_BLACKLIST=other
68+
BROWSER_LOG_BLOCKLIST=other
6969

7070
#*** Elastic Search version used for test ***#
7171
ELASTICSEARCH_VERSION=7

src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function afterStep(\Codeception\Event\StepEvent $e)
201201
{
202202
$browserLog = $this->getDriver()->webDriver->manage()->getLog("browser");
203203
if (getenv('ENABLE_BROWSER_LOG') === 'true') {
204-
foreach (explode(',', getenv('BROWSER_LOG_BLACKLIST')) as $source) {
204+
foreach (explode(',', getenv('BROWSER_LOG_BLOCKLIST')) as $source) {
205205
$browserLog = BrowserLogUtil::filterLogsOfType($browserLog, $source);
206206
}
207207
if (!empty($browserLog)) {

src/Magento/FunctionalTestingFramework/Page/Handlers/PageObjectHandler.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class PageObjectHandler implements ObjectHandlerInterface
2323
const PARAMETERIZED = 'parameterized';
2424
const AREA = 'area';
2525
const FILENAME = 'filename';
26-
const NAME_BLACKLIST_ERROR_MSG = "Page names cannot contain non alphanumeric characters.\tPage='%s'";
26+
const NAME_BLOCKLIST_ERROR_MSG = "Page names cannot contain non alphanumeric characters.\tPage='%s'";
2727

2828
/**
2929
* The singleton instance of this class
@@ -58,7 +58,7 @@ private function __construct()
5858
$pageNameValidator = new NameValidationUtil();
5959
foreach ($parserOutput as $pageName => $pageData) {
6060
if (preg_match('/[^a-zA-Z0-9_]/', $pageName)) {
61-
throw new XmlException(sprintf(self::NAME_BLACKLIST_ERROR_MSG, $pageName));
61+
throw new XmlException(sprintf(self::NAME_BLOCKLIST_ERROR_MSG, $pageName));
6262
}
6363

6464
$filename = $pageData[self::FILENAME] ?? null;

src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ActionObjectExtractor extends BaseObjectExtractor
2727
const ACTION_GROUP_ARGUMENTS = 'arguments';
2828
const ACTION_GROUP_ARG_VALUE = 'value';
2929
const BEFORE_AFTER_ERROR_MSG = "Merge Error - Steps cannot have both before and after attributes.\tStepKey='%s'";
30-
const STEP_KEY_BLACKLIST_ERROR_MSG = "StepKeys cannot contain non alphanumeric characters.\tStepKey='%s'";
30+
const STEP_KEY_BLOCKLIST_ERROR_MSG = "StepKeys cannot contain non alphanumeric characters.\tStepKey='%s'";
3131
const STEP_KEY_EMPTY_ERROR_MSG = "StepKeys cannot be empty.\tAction='%s'";
3232
const DATA_PERSISTENCE_CUSTOM_FIELD = 'field';
3333
const DATA_PERSISTENCE_CUSTOM_FIELD_KEY = 'key';
@@ -70,7 +70,7 @@ public function extractActions($testActions, $testName = null)
7070
}
7171

7272
if (preg_match('/[^a-zA-Z0-9_]/', $stepKey)) {
73-
throw new XmlException(sprintf(self::STEP_KEY_BLACKLIST_ERROR_MSG, $actionName));
73+
throw new XmlException(sprintf(self::STEP_KEY_BLOCKLIST_ERROR_MSG, $actionName));
7474
}
7575

7676
$actionAttributes = $this->stripDescriptorTags(

src/Magento/FunctionalTestingFramework/Test/Util/TestObjectExtractor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function getAnnotationExtractor()
9090
*/
9191
public function extractTestData($testData, $validateAnnotations = true)
9292
{
93-
// validate the test name for blacklisted char (will cause allure report issues) MQE-483
93+
// validate the test name for blocklisted char (will cause allure report issues) MQE-483
9494
NameValidationUtil::validateName($testData[self::NAME], "Test");
9595

9696
$testAnnotations = [];

0 commit comments

Comments
 (0)