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

Some issues related to development infrastructure #1445

Open
pavelevap opened this issue May 12, 2019 · 3 comments
Open

Some issues related to development infrastructure #1445

pavelevap opened this issue May 12, 2019 · 3 comments
Labels
help wanted Good issue for community contribution – no need for deep knowledge of VP internals improvement Improvement of an existing functionality. See "feature" for new features. scope: dev-infrastructure Build scripts, IDE settings, CI, Docker dev stack, testing, tooling, etc.
Milestone

Comments

@pavelevap
Copy link
Collaborator

I will only gather some notes from testing here.

  • When starting development environment (npm start), localhost does not work immediatelly, because we are not waiting for MySQL to start (see related commit for testing: c1a1fbb).

  • Network conflict when development environment is active (npm start) and you can try to run full tests, and vice versa.

> Cleaning up Docker containers and volumes...
Found orphan containers (vptest_wordpress_1, vptest_adminer_1, vptest_mysql_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Removing network vptest_default
error while removing network: network vptest_default id 371fa07f3c3c6bb11d61afbf24f19c770477f45274d0b11759d1d1e51b4d83c4 has active endpoints

> Starting MySQL...
Found orphan containers (vptest_wordpress_1, vptest_adminer_1, vptest_mysql_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Creating vptest_mysql-for-tests_1 ... error

ERROR: for vptest_mysql-for-tests_1  Cannot start service mysql-for-tests: driver failed programming external connectivity on endpoint vptest_mysql-for-tests_1 (333000719d6d630d6a2ebadcf3696fa2f773fa17c9b2f06408e2fd73bf2e1486): Bind for 0.0.0.0:3306 failed: port is already allocated

ERROR: for mysql-for-tests  Cannot start service mysql-for-tests: driver failed programming external connectivity on endpoint vptest_mysql-for-tests_1 (333000719d6d630d6a2ebadcf3696fa2f773fa17c9b2f06408e2fd73bf2e1486): Bind for 0.0.0.0:3306 failed: port is already allocated
Encountered errors while bringing up the project.
@pavelevap pavelevap added improvement Improvement of an existing functionality. See "feature" for new features. scope: dev-infrastructure Build scripts, IDE settings, CI, Docker dev stack, testing, tooling, etc. labels May 12, 2019
@borekb
Copy link
Member

borekb commented May 17, 2019

I agree, I'm hitting similar issues.

Dev setup should generally follow the recent updates to our testing infrastructure in #1389 (dev setup itself has last been updated about a year earlier, in #1329). For example:

  • Add a script similar to run-tests (New run-tests.ts, making test runs more reliable #1401) that would coordinate Docker stack startup.
  • Use different ports for dev and tests, as you noted, @pavelevap.
  • Reconsider volume mapping – it makes things very slow.
  • Maybe provide a way to start the site already initialized and with VersionPress activated (a bit double edged but I'd often find it convenient).
  • Verify that the developer experience, incl. debugging and similar, is good.

The only problem is that this usually takes time to experiment with and I'll struggle to find. I'll add a 'help wanted' label as this is a relatively good issue to get started without any deeper knowledge of VersionPress.

@borekb borekb added the help wanted Good issue for community contribution – no need for deep knowledge of VP internals label May 17, 2019
@borekb borekb added this to the 4.0 milestone May 17, 2019
@borekb
Copy link
Member

borekb commented May 19, 2019

Note entirely sure if we'll be able to use it but VSCode's remote development with containers seems really nice. Here's a short video overview.

@borekb
Copy link
Member

borekb commented May 21, 2019

Found some notes from when I was working on #1389, posting them here as they were:


  • The stop scripts use docker-compose stop – I don't know why, it should be down to also remove the containers.
  • Update npm start script to print "Wait for WordPress to start – it might take a minutes, then visit http://localhost".
    • This could actually be a start-wp.ts script
  • Update Dev-setup/Writing code section.
  • PhpStorm 2018.1 is quite old in Dev Setup.
  • localhost instead of wordpress-for-tests in test-config.yml?
  • "Developing the dev setup" – info on digests.
  • Update Docker frequently!
  • Recommend PHP 7.2 to be aligned with Docker images.
  • Commit launch.json to repo.
    • Possibly rename .ide-tpl na .idea-tpl – it's only for PhpStorm, VSCode can be committed directly.
  • Switch to Yarn: workspaces, no tricky -- when running scripts, etc.
  • Stop dev env before running tests
  • Tips for Docker:
    • If weird things happen, restart Docker. For example, I saw tests run time drop from 30m to 10m after just restarting Docker Desktop on a Mac.
    • DockStation
  • Dockerized environment should be linked between dev-setup.md and testing.md
  • For scripts: Prettier, ESLint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Good issue for community contribution – no need for deep knowledge of VP internals improvement Improvement of an existing functionality. See "feature" for new features. scope: dev-infrastructure Build scripts, IDE settings, CI, Docker dev stack, testing, tooling, etc.
Projects
None yet
Development

No branches or pull requests

2 participants