Skip to content

Conversation

@jilu1
Copy link
Contributor

@jilu1 jilu1 commented Dec 3, 2018

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 Dec 3, 2018

Coverage Status

Coverage decreased (-0.02%) to 57.039% when pulling 8efe995 on MQE-1354 into 4522886 on develop.

@KevinBKozan KevinBKozan changed the title Mqe 1354 MQE-1354 Dec 5, 2018
@jilu1 jilu1 changed the title MQE-1354 MQE-1353 & 1354 Dec 7, 2018
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.

Minor QA stuff and a fundamental issue with the arguments attribute.

$tokenPassedIn = urldecode($_POST['token']);
$command = urldecode($_POST['command']);

if (array_key_exists("arguments", $_POST)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that this statement is ever false. Need to add a clause && !empty($_POST['arguments']), or otherwise not post arguments in MagentoWebDriver if they are null.

This is leading to weird behavious below

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


if (array_key_exists("arguments", $_POST)) {
$arguments = urldecode($_POST['arguments']);
$arguments = escapeshellarg(urldecode($_POST['arguments']));
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure we can use escapeshellarg. According to documentation it will always add single quotes to the output, which will likely break existing tests.
Additionally, Devdocs calls out the arguments attribute as Unescaped arguments to be passed in with the CLI command.

By escaping the argument, it breaks functionality. I am not sure what to do here, as I think the token requirement is enough to prevent unwanted commands from running, and the need to be able to pass in an unescaped JSON string is an existing requirement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed command arguments escaping

KevinBKozan
KevinBKozan previously approved these changes Dec 13, 2018
# Conflicts:
#	src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php
@jilu1 jilu1 merged commit a88548b into develop Dec 14, 2018
@jilu1 jilu1 deleted the MQE-1354 branch December 14, 2018 16:11
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.

6 participants