Skip to content

Include tests-mysql port in dev:start output#38590

Merged
talldan merged 1 commit intoWordPress:trunkfrom
jblz:patch-1
Feb 8, 2022
Merged

Include tests-mysql port in dev:start output#38590
talldan merged 1 commit intoWordPress:trunkfrom
jblz:patch-1

Conversation

@jblz
Copy link
Copy Markdown
Contributor

@jblz jblz commented Feb 7, 2022

Description

When running npm run wp-env start, print the host-local port which is mapped for the tests-mysql container:

'tests-mysql': {
image: 'mariadb',
ports: [ '3306' ],
environment: {
MYSQL_ROOT_PASSWORD:
dbEnv.credentials.WORDPRESS_DB_PASSWORD,
MYSQL_DATABASE: dbEnv.tests.WORDPRESS_DB_NAME,
},
volumes: [ 'mysql-test:/var/lib/mysql' ],
},

This is in addition to the port for the "standard" mysql container which is printed in a similar manner immediately prior to the line in this change.

My workaround has been to run a script like this:
docker-compose -f $(npm run --silent wp-env install-path)/docker-compose.yml port tests-mysql 3306 and inspect the port returned.

Testing Instructions

  • Clone this branch
  • npm i
  • npm run wp-env start
  • Note the correct port number on the host machine which points to port 3306 on the tests-mysql container.

Screenshots

Screenshot from 2022-02-07 12-32-40

Types of changes

New feature (non-breaking change which adds functionality)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).
  • I've updated related schemas if appropriate.

@jblz jblz marked this pull request as ready for review February 7, 2022 17:41
@jblz jblz requested a review from noahtallen as a code owner February 7, 2022 17:41
@talldan talldan added [Tool] Env /packages/env [Type] Enhancement A suggestion for improvement. labels Feb 8, 2022
Copy link
Copy Markdown
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for working on this.

It might be good to tidy up the console output at some point, but while there are only four lines of text it doesn't seem much of an issue. Maybe if anything more is added it can be considered. 😄

@talldan talldan merged commit 1b9fe38 into WordPress:trunk Feb 8, 2022
@github-actions github-actions bot added this to the Gutenberg 12.6 milestone Feb 8, 2022
@jblz jblz deleted the patch-1 branch February 8, 2022 04:03
@noahtallen
Copy link
Copy Markdown
Member

Thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Tool] Env /packages/env [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants