Skip to content

Mqe 1734 Add base + merge files to Test Description #468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 27, 2019
Merged

Conversation

jilu1
Copy link
Contributor

@jilu1 jilu1 commented Sep 23, 2019

Description

Fixed Issues (if relevant)

  1. magento/magento2-functional-testing-framework#<issue_number>: Issue title
  2. ...

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/verification tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)
  • Changes to Framework doesn't have backward incompatible changes for tests or have related Pull Request with fixes to tests

@coveralls
Copy link

coveralls commented Sep 23, 2019

Coverage Status

Coverage increased (+1.2%) to 53.339% when pulling 980892e on MQE-1734 into 53e33f6 on develop.

Copy link
Contributor

@KevinBKozan KevinBKozan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions for code simplicity + request for bolding text.

{
$title = '';
foreach ($fileNames as $fileName) {
if (!empty($fileName && realpath($fileName) !== false)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line should read

if (!empty($fileName) && realpath($fileName) !== false) {

Note empty() function closing parenthesis

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. I wonder how it even worked?

DIRECTORY_SEPARATOR
);
if (!empty($relativeFileName)) {
if (empty($title)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get rid of this conditional by setting $title = '<br><br>Test Files:<br>' on line 184 and returning return $description .= $title instead.

I understand that this would mean if no filenames are passed in that you'd have a partial description, but I think that's okay since we want to be able to easily tell processing of it went wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another side effect of this is that it will break unit tests.

@@ -118,6 +118,21 @@ public function extractTestData($testData)
//Override features with module name if present, populates it otherwise
$testAnnotations["features"] = [$module];

// Append test file names in description annotation
if (!empty($fileNames)) {
if (isset($testAnnotations["description"][0])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check if description array is set at all and set it. You can also simplify these conditionals:

if (!empty($fileNames)) {
    if (!isset($testAnnotations["description"])) {
        $testAnnotations["description"] = [];
    }
    $description = $testAnnotations["description"][0] ?? '';
    $testAnnotations["description"][0] = $this->appendFileNamesInDescriptionAnnotation($description, $fileNames);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My code just set the array value directly regardless of description array is set or not, but your code looks more strait forward. I will double check and change it if it works.

);
if (!empty($relativeFileName)) {
if (empty($title)) {
$title .= '<br><br>Test Files:<br>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asked around for opinions, we should bold the <b>Test Files:</b> for better readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's obvious that bold is better. I will just go ahead change it

@KevinBKozan
Copy link
Contributor

@jilu1 Please kick off a build with your branch to check for artifact size increase + filepath scrubbing to make sure. Otherwise this is good to go.

@jilu1
Copy link
Contributor Author

jilu1 commented Sep 26, 2019

@KevinBKozan I have run builds after my change https://m2build-ur.devops.magento.com/job/All-User-Requested-Tests/24447/ and font looks much better than before. The link is in MQE ticket.

@KevinBKozan
Copy link
Contributor

Very nice, didn't see it. Approved then!

KevinBKozan
KevinBKozan previously approved these changes Sep 26, 2019
@jilu1 jilu1 merged commit 50ace76 into develop Sep 27, 2019
@jilu1 jilu1 deleted the MQE-1734 branch February 6, 2020 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants