This commits reduces the execution time of the test WC_Tests_Paypal_Gateway_Request::test_request_url() from about 30s to about 6s (which is still super slow and even after this change this test is still the slowest in our test suite). This test creates several products that are needed to test different scenarios. To make it run faster, the code was changed to create the WC_Product objects without saving them to the database. Just interacting with the objects is enough to this test and skipping the database makes it run much faster. Other tests might benefit from the same technique.
The placeholder string that is displayed in the address_2 field in the checkout was changed in #20639 to hide the "(optional)" part when the field is mandatory. The problem is that this was done splitting the sentence in two parts which goes against i18n best practices (https://developer.wordpress.org/themes/functionality/internationalization/#best-practices-for-writing-strings) as the order of the words can be different depending on the language. This commit creates two full sentences one with the "(optional)" part and another one without it to better support the translation of both strings.
This commit is an attempt to reduce the noise in PRs generated by the code coverage comment posted automatically by Codecov. It changes Codecov configuration to post a comment to a PR only if it changes the code coverage and it also removes reach graph, the diff image and the flags from the comment content. Leaving only a list of the files impacted by the PR. My initial plan was to leave in the comment content only a link to the full report, but I couldn't find a way to do that in the documentation (https://docs.codecov.io/docs/pull-request-comments).
Tests should be consistent. That is true for our unit tests suite, but it is something that is harded to achieve for functional tests. Our end to end tests often times fail due to factors outside of our control, and simply manually restarting the Travis build is enough to make them pass (example: https://github.com/woocommerce/woocommerce/pull/21150#issuecomment-415132390). This commits uses `travis_retry` to make Travis automatically retry a maximum of three times to run WC e2e tests in case of a failure.
This commit removes unnecessary clean up code form some unit tests. All database changes done during a test are automatically reverted after the test finishes, so it is not necessary to write code to manually remove them. This change simplifies the test code and make it run a bit faster.