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

Update some tests and config to be more maintainable #12356

Merged
merged 15 commits into from Aug 30, 2022

Conversation

hasezoey
Copy link
Collaborator

Summary

This PR does:

  • change from mocha.opts to mocha.yml because mocha stopped supporting the .opts format
  • re-set the ANSI color for the SHARD warning (otherwise the next console log's / debug logs would also be in that color)
  • change common.js's uris to be consistent across both uri and uri2 (before only uri would have the env applied)
  • change common.js to have a extra value databases so that the databases for uri and uri2 can also be used for things like useDb instead of just the full uri's
  • change many tests from static uri's to use common.js's uri and uri2
  • change many tests from static database names to use common.js's databases array
  • change many tests to unify database naming to what is available in common.js's databases array
  • change model.populate.test.js to not create connections in the tests themself when not required (and use global instead)
  • change model.populate.test.js to handle cleaning db2 outside of the tests themself

Note: some changes have been cherry-picked from #12262 to have them already applied (because i dont know how long that PR will be open for) and those changes were unrelated to the point of the mentioned PR

Note for the mocha opts change: i have not re-set the reporter to be dot but instead spec because this is way more readable (both in CI and locally)

…debugging

(to see the actual count instead of "falsy value)
…tead

this change is needed, because "start.uri" is now a getter and global variables in mocha get envaluated before a global-setup
also change some static connection strings to use "start.uri"
for use in "useDb" instead of combined with just the URI
@Uzlopak Uzlopak merged commit 3b062ee into Automattic:master Aug 30, 2022
@hasezoey hasezoey deleted the testUpdate branch August 30, 2022 14:14
@hasezoey hasezoey added this to the 6.5.4 milestone Sep 1, 2022
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

2 participants