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

[LOPS-1661] Fix long tests #2496

Merged
merged 3 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/3x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
env:
TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }}
TERMINUS_SITE: ${{ secrets.TERMINUS_SITE }}
TERMINUS_SITE_WP: ${{ secrets.TERMINUS_SITE_WP }}
TERMINUS_SITE_WP_NETWORK: ${{ secrets.TERMINUS_SITE_WP_NETWORK }}
TERMINUS_ORG: ${{ secrets.TERMINUS_ORG }}
TERMINUS_BASE_DIR: ${{ secrets.TERMINUS_BASE_DIR }}
TERMINUS_PLUGINS_DIR: ${{ secrets.TERMINUS_PLUGINS_DIR }}
Expand Down
13 changes: 9 additions & 4 deletions src/Models/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,15 @@ public function cloneDatabase(Environment $from_env, array $options = [])
if (isset($options['updatedb'])) {
$options['updatedb'] = (int)$options['updatedb'];
}
$params = array_merge(
['from_environment' => $from_env->getName(),],
$options
);
$params = [
'from_environment' => $from_env->getName(),
'updatedb' => $options['updatedb'] ?? 0,
'clear_cache' => $options['clear_cache'] ?? false,
];
if (!empty($options['from_url']) && !empty($options['to_url'])) {
$params['wp_replace_siteurl']['from_url'] = $options['from_url'];
$params['wp_replace_siteurl']['to_url'] = $options['to_url'];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

So, was it something about WP search-replace that was causing the long tests to fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was one of the failing tests, probably broken since it was created and never noticed.

There were other failing tests also fixed in this PR

return $this->getWorkflows()->create(
'clone_database',
compact('params')
Expand Down
1 change: 1 addition & 0 deletions src/Terminus.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ private function addBuiltInCommandsAndHooks()
{
// List of all hooks and commands. Update via 'composer update-class-lists'
$this->commands = [
'Consolidation\\Filter\\Hooks\\FilterHooks',
Copy link
Contributor

Choose a reason for hiding this comment

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

what's this do?

(i could try reading documentation but it's easier to just ask you)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

--filter to Terminus commands. It was removed by mistake in a previous PR and all of the commands tests that use that argument are failing now

'Pantheon\\Terminus\\Hooks\\Authorizer',
'Pantheon\\Terminus\\Hooks\\RoleValidator',
'Pantheon\\Terminus\\Hooks\\SiteEnvLookup',
Expand Down
Loading