Skip to content
This repository has been archived by the owner on Jan 2, 2020. It is now read-only.

Database: add support to delete generated database dumps after-scenario. #259

Closed
wants to merge 44 commits into from

Conversation

paulgibbs
Copy link
Owner

Description

If WordHat is configured to generate a DB dump during its run, WordHat was leaving alot of files littering up PHP's temporary folder.

Related issue

#227

Motivation and context

Stops cluttering up disk space. Database dumps could be large! Every megabyte counts!

How has this been tested?

Locally.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

paulgibbs and others added 30 commits October 20, 2019 21:32
- `joomla-projects/selenium-server-standalone`
- `phing/phing`
WordHat now requires WP-CLI v2+.
Version 2.1 of this package requires PHP 7.1, and version 2.2+ require PHP 7.2.
Given Behat supports back to PHP 7.1 currently, we can't upgrade to a newer
release of `ocramius/proxy-manager` yet.

I also forget this every time I try to update Composer, so I'm hoping i'll
remember this time!
… session.

We believe this to be a cause of form field manipulation intermittently
failing, causing the log-in step to fail -- as "Given I am logged in as a user"
is often the the first line in a scenario!

See Behat/MinkExtension#286

This is the latest attempt in a long line of fixes to make Behat user log-in
reliable. See #47 for the history.
Try to avoid the Selenium browser aggresively logging the user out.

See #245
This is temporarily removed to see if this is the cause of intermittent
behaviour about a user being logged out mid-test.
After scenario, we instruct Mink to reset the browser environment.
It will try to clear the cookies and reset the request headers and the
browser history to the limit of the Mink webdriver possibilities.

Instead of a reset, this change forces Mink to close and re-open the browser.

Behaviour has been seen where a Selenium tests leaves open a browser window
after a test is complete, and not close it. The 'after scenario' will clear
session cookies in that browser, and eventually, the WordPress application's
heartbeat API will render a blocking modal showing "you must log-in again".

This can interfere with subsequent tests in that browser, as visiting a URL
can sometimes cause a browser "are you sure you want to leave this page" prompt
to appear which breaks navigation.

It also confuses the user running about if the tests all actually passed.
This will eventually let people translate WordHat steps for their own use.
There are no plans currently to bundle translations with WordHat at this time.

For #206
It turns out that while the Selenium driver supports switching into an iframe
context, the ChromeDriver implementation doesn't switch the browser JS context.

We can use `the_iframe.contentDocument.body` as an alternative to the current
implementation, and it works with both Chrome and Selenium drivers.
A switch of the project requiring PHP 7.2 should let us remove this workaround.
It used to break only on Travis-CI when you run the project in different
versioned PHP environments, so let's find out...
If WordHat is configured to generate a DB dump during its run, WordHat was
leaving alot of files littering up PHP's temporary folder. Sorry!

See #227
@paulgibbs
Copy link
Owner Author

I must have rebased this destructively some point in the past, I'm doing a new PR.

@paulgibbs paulgibbs closed this Oct 20, 2019
@paulgibbs paulgibbs deleted the fix/227-rm-db-dump branch October 20, 2019 22:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants