exercism / development-environment

16 stars 19 forks source link

Documentation improvements for first timers #36

Open neenjaw opened 3 years ago

neenjaw commented 3 years ago

Hey,

Great work on the dev environment.

Comments while working through the setup:

Now my question, If I were to be writing a rails ruby module, how should I be running the tests (e.g. ActiveTest)?

I'm happy to PR the documentation with these updates

Thanks

ErikSchierboom commented 3 years ago

There is a delay from the time that ./bin/start says the website is running until the time when it is actually running. This time is probably normal spin up time, but it might be worthwhile and preemptive to state that there might be some delay.

I've tried to detect if the website is running, but apparently that is not working. There might be bug in there somewhere. The idea is that we keep looping until a request to the home page returns data with a <body> tag in it.

Also noted that the setup container shuts itself down once the system is running. When looking at my docker widget I wasn't sure if this is normal, but the system appears to be running. If this is normal and expected it might be worth noting.

This is indeed normal. It is just a one-time setup.

Now my question, If I were to be writing a rails ruby module, how should I be running the tests (e.g. ActiveTest)?

Does the website have to be running at that moment? Or just parts of it (DB, etc).

The website has to be running. Well, the website container has to be running to be specific, as tests are executed in the context of that container.

Are they run locally, or do you have to shell in to one of the docker containers

For the development environment, I always running them in the Docker container. You could run them locally if you'd like, but that would also mean you'd have to have a local database setup and such. My recommendation would be to just run in the container.

I'm happy to PR the documentation with these updates

This would be much appreciated! 💙

neenjaw commented 3 years ago

Okay, some followup questions, what is your workflow testing a feature that is on a development branch in the container?

  1. shell into the container
  2. ___ :arrow_left: What goes here: do you have to stop the rails server, change git branches, etc?
  3. run tests in the container
iHiD commented 3 years ago

From within this repo, run ./bin/script website run-tests

neenjaw commented 3 years ago

Can you select a feature branch? Or does that run whatever is on the master/main branch?

iHiD commented 3 years ago

It runs the script in the context of the docker machine. That's basically the equivelent of SSHing into the machine and running the script. So it runs whatever branch is checked out and running in that docker machine.

neenjaw commented 3 years ago

I'll give it a go!

ErikSchierboom commented 3 years ago

Note that there are several actually three different test scripts that can be run: