Skip to content

Commit ca63481

Browse files
committed
MQE-2150: group value "skip" no longer causes test to be skipped
1 parent cdc5188 commit ca63481

File tree

9 files changed

+34
-34
lines changed

9 files changed

+34
-34
lines changed

dev/tests/verification/Resources/SkippedTestNoIssues.txt renamed to dev/tests/verification/Resources/GroupSkipGenerationTest.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,22 @@ use Yandex\Allure\Adapter\Model\SeverityLevel;
1313
use Yandex\Allure\Adapter\Annotation\TestCaseId;
1414

1515
/**
16-
* @Title("[NO TESTCASEID]: skippedNoIssuesTest")
17-
* @Description("<h3>Test files</h3>verification/TestModule/Test/SkippedTest/SkippedTestNoIssues.xml<br>")
16+
* @Title("[NO TESTCASEID]: GroupSkipGenerationTestTitle")
17+
* @Description("GroupSkipGenerationTestDescription<h3>Test files</h3>verification/TestModule/Test/GroupSkipGenerationTest.xml<br>")
1818
* @group skip
1919
*/
20-
class SkippedTestNoIssuesCest
20+
class GroupSkipGenerationTestCest
2121
{
2222
/**
23-
* @Stories({"skippedNo"})
23+
* @Stories({"GroupSkipGenerationTestStory"})
2424
* @Severity(level = SeverityLevel::MINOR)
2525
* @Features({"TestModule"})
2626
* @Parameter(name = "AcceptanceTester", value="$I")
2727
* @param AcceptanceTester $I
2828
* @return void
2929
* @throws \Exception
3030
*/
31-
public function SkippedTestNoIssues(AcceptanceTester $I, \Codeception\Scenario $scenario)
31+
public function GroupSkipGenerationTest(AcceptanceTester $I)
3232
{
33-
$scenario->skip("This test is skipped due to the following issues:\nNo issues have been specified.");
3433
}
3534
}

dev/tests/verification/TestModule/Test/SkippedTest/SkippedTestNoIssues.xml renamed to dev/tests/verification/TestModule/Test/GroupSkipGenerationTest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
-->
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10-
<test name="SkippedTestNoIssues">
10+
<test name="GroupSkipGenerationTest">
1111
<annotations>
12-
<stories value="skippedNo"/>
13-
<title value="skippedNoIssuesTest"/>
14-
<description value=""/>
12+
<stories value="GroupSkipGenerationTestStory"/>
13+
<title value="GroupSkipGenerationTestTitle"/>
14+
<description value="GroupSkipGenerationTestDescription"/>
1515
<severity value="AVERAGE"/>
1616
<group value="skip"/>
1717
</annotations>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace tests\verification\Tests;
7+
8+
use tests\util\MftfTestCase;
9+
10+
class GroupSkipGenerationTest extends MftfTestCase
11+
{
12+
/**
13+
* Tests group skip test generation
14+
*
15+
* @throws \Exception
16+
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
17+
*/
18+
public function testGroupSkipGenerationTest()
19+
{
20+
$this->generateAndCompareTest('GroupSkipGenerationTest');
21+
}
22+
}

dev/tests/verification/Tests/SkippedGenerationTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,4 @@ public function testMultipleSkippedIssuesGeneration()
4141
{
4242
$this->generateAndCompareTest('SkippedTestTwoIssues');
4343
}
44-
45-
/**
46-
* Tests skipped test generation with no specified issues. Will be deprecated after MFTF 3.0.0
47-
*
48-
* @throws \Exception
49-
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
50-
*/
51-
public function testSkippedNoIssueGeneration()
52-
{
53-
$this->generateAndCompareTest('SkippedTestNoIssues');
54-
}
5544
}

docs/merging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ To add a `<test>`, create a new `*Test.xml` file or add a `<test>` node to an ex
3535
## Remove a test
3636

3737
Tests cannot be removed while merging.
38-
If a [`<test>`][tests] must be skipped due to a module completely invalidating a function, you can add the test to the `skip` group.
38+
If a [`<test>`][tests] must be skipped due to a module completely invalidating a function, you can use `skip` annotation to skip the test.
3939

4040
Learn more about running tests with different options using [`mftf`] or [`codecept`] commands.
4141

docs/suite.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The format of a suite:
4646
- must not match any existing group value.
4747
For example, the suite `<suite name="ExampleTest">` will fail during test run if any test contains in annotations `<group value="ExampleTest">`.
4848
- must not be `default` or `skip`. Tests that are not in any suite are generated under the `default` suite.
49-
The suite name `skip` is synonymous to including a test in the `<group value="skip"/>`, which will be deprecated in MFTF 3.0.0.
49+
The suite name `skip` is synonymous to including a test in the `<group value="skip"/>`.
5050
- can contain letters, numbers, and underscores.
5151
- should be upper camel case.
5252

docs/test/annotations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Add `<skip>` to the test to skip it during test run.
8787

8888
Attribute|Type|Use|Definition
8989
---|---|---|---
90-
`value`|string|required|A value that is used to group tests. It should be lower case. `skip` is reserved to ignore content of the test and generate an empty test.
90+
`value`|string|required|A value that is used to group tests. It should be lower case.
9191

9292
#### Example
9393

src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,8 @@ public function getDeprecated()
161161
*/
162162
public function isSkipped()
163163
{
164-
// TODO deprecation|deprecate MFTF 3.0.0 remove elseif when group skip is no longer allowed
165164
if (array_key_exists('skip', $this->annotations)) {
166165
return true;
167-
} elseif (array_key_exists('group', $this->annotations) && (in_array("skip", $this->annotations['group']))) {
168-
return true;
169166
}
170167
return false;
171168
}

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,6 @@ public function extractAnnotations($testAnnotations, $filename, $validateAnnotat
9292
foreach ($annotationData as $annotationValue) {
9393
$annotationValues[] = $annotationValue[self::ANNOTATION_VALUE];
9494
}
95-
// TODO deprecation|deprecate MFTF 3.0.0
96-
if ($annotationKey == "group" && in_array("skip", $annotationValues)) {
97-
LoggingUtil::getInstance()->getLogger(AnnotationExtractor::class)->warning(
98-
"Use of group skip will be deprecated in MFTF 3.0.0. Please update tests to use skip tags.",
99-
["test" => $filename]
100-
);
101-
}
10295

10396
$annotationObjects[$annotationKey] = $annotationValues;
10497
}

0 commit comments

Comments
 (0)