Skip to content
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/source repository tests #115

Merged
merged 21 commits into from
May 25, 2023

Conversation

convenient
Copy link
Contributor

@convenient convenient commented May 23, 2023

TODO - Squash merge this PR

Some improvements for the test running on this branch.

  • Patch a bug in 2.4.4 that stops fixtures working in integration tests because tables are prefixed with trv_. I want to keep the versions under test as clear as possible, but this wont affect most use cases and will allow us to get the tests going through
  • Clear the sales channel cache before running the tests
  • Some DAMP vs DRY readability changes https://stackoverflow.com/a/11837973/4354325
    • this removed some dead code also

public function getTableName(int $stockId): string
{
- return 'reservations_temp_for_stock_' . $stockId;
+ return $this->resourceConnection->getTableName('reservations_temp_for_stock_' . $stockId);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Handles table prefixes, affects integration tests in as all tables are prefixed there. Broken for 2.4.4 series.

* @dataProvider sourcesDataProvider
*
* @magentoDataFixture Magento_InventorySalesApi::Test/_files/websites_with_stores.php
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reorder so this is the first applied, and last to roll back

@convenient convenient marked this pull request as ready for review May 25, 2023 16:48
@convenient convenient merged commit 4f35d8d into fix/SourceRepository May 25, 2023
0 of 2 checks passed
@convenient convenient deleted the fix/SourceRepository-tests branch May 25, 2023 16:49
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.

None yet

1 participant