-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fix integration test expectation to match count of countries in the database #5095
Fix integration test expectation to match count of countries in the database #5095
Conversation
Strange - locally the original test fails because it expects 246 (hardcoded), but the country select only contains 245 options, so my change made it pass. |
I can't look into travis to see what happens there, but at least I can look how the local option count ends up being 245: The country options list is created by foreach ($options as $data) {
$name = (string)$this->_localeLists->getCountryTranslation($data['value']);
if (!empty($name)) {
$sort[$name] = $data['value'];
}
} In the local build, Then, at the end of the if (count($options) > 0 && $emptyLabel !== false) {
array_unshift($options, ['value' => '', 'label' => $emptyLabel]);
} This brings the option back up to 245. My guess is that on the travis build the localized country name returned by The address form actually is being built correctly, so I think not. The issue should probably be covered by a test for |
Okay, this version of the test passes locally and on travis. The PR reduces the scope of the test to just check the country options get rendered in the form. Accepting this PR would help keeping other CI pipelines working out of the box. |
Hi @Vinai , |
…nt of countries in the database #5095
[Performance] Random failure of PAT builds
This PR applies to the 2.1.0-rc3 and develop branches.
It probably already is fixed upstream though since it is a simple test failure due to a hardcoded expectation that actually is a value from the database.
Details:
The number of countries in the database seems to have changed.
The test
\Magento\Sales\Block\Adminhtml\Order\Create\Form\AddressTest::testGetForm()
hardcoded the expected number of options in the country select to 246.The number of records created in that table by
\Magento\Directory\Setup\InstallData::install()
is 245.This PR adjusts the test so it expects the number of options in the select to match the number countries in the system country directory.