Skip to content

Conversation

@fredrikekelund
Copy link
Contributor

Fixes https://github.com/Automattic/dotcom-forge/issues/9976

Following up from #5, this PR adds two Behat tests for the wp sqlite tables command.

Because I wasn't previously familiar with Behat, I also took the opportunity to add some rudimentary docs.

@fredrikekelund fredrikekelund self-assigned this Nov 27, 2024
Copy link
Contributor

@wojtekn wojtekn left a comment

Choose a reason for hiding this comment

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

Thanks for documenting tests!

The test cases depend on real WordPress installations, meaning the usual PHP and MySQL dependencies are required. However, we can opt to use SQLite instead of MySQL to make running the tests locally easier. Here's how to run the full test suite with a SQLite database:

```
WP_CLI_TEST_DBTYPE=sqlite vendor/bin/behat
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! I missed that before, and I was running those tests by providing a path to MySQL.

@fredrikekelund
Copy link
Contributor Author

It doesn't look like we run these tests with CI 🤔 I'll take a quick look at that, too, but I might submit a fix separately

@fredrikekelund
Copy link
Contributor Author

fredrikekelund commented Nov 28, 2024

It looks like the Testing workflow had been automatically disabled because Github does that when a repo has been inactive for N days, and the action uses a cron schedule (which this action did).

I assume we'll be using pull requests to push new code to this repo at this point, meaning I don't see a clear point in running that workflow on a cron schedule. I removed the cron schedule to prevent the same thing from happening again.

@fredrikekelund fredrikekelund merged commit 072503e into main Nov 28, 2024
28 checks passed
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.

3 participants