datafolklabs / cement

Application Framework for Python
http://builtoncement.com
BSD 3-Clause "New" or "Revised" License
1.25k stars 117 forks source link

Vagrant development and testing environment #483

Closed samlikins closed 6 years ago

samlikins commented 6 years ago

I noticed that a development/testing environment using Vagrant was started. Upon attempting to use it I got errors, and upon further investigation I noticed several discrepancies. The Vagrantfile and scripts/vagrant/up.sh file need attention, and perhaps a more detailed review of the development/testing environment all together.

derks commented 6 years ago

@samlikins I wouldn't spend too much time here... I've moved toward Docker for all local development and testing.

In the portland branch, you can now do:

$ docker-compose up

$ docker-compose exec cement /bin/ash

The Docker Compose setup runs all necessary services to develop, and run tests (i.e. a memcached instance, a redis instance, etc). The second command drops you into a development shell (Alpine Linux)... so all requirements, services, etc are all automatically ready for dev with just those two commands. I am powering through moving all tests to PyTest right now, and getting everything back to 100% test coverage... then I will be combing through all the README and Documentation to cover all this well.

Windows will still require Vagrant atleast until I can get a Windows Server 2016 setup with Docker, but it's low priority at the moment.

samlikins commented 6 years ago

@derks: I don't have docker installed on my system, and do all my development with Vagrant. Some developers may prefer a Vagrant environment over docker. Are you hard set on removing Vagrant?

derks commented 6 years ago

No, not at all.. like I said Vagrant is still required for Windows currently. There are also other edge cases where Vagrant is helpful (like troubleshooting issues with a specific OS, and/or other services/software that would make more sense to run in Vagrant. That said, all current development is happening in Docker so it is slightly prioritized that way (for me anyway).

I will use this issue tracker to ensure Vagrant development is setup the best way possible... I haven't used Vagrant on this project it in a while so I'm not surprised the config is busted.

samlikins commented 6 years ago

@derks if you look at the PR I submitted to the portland branch, I've made the necessary changes to make it viable for dev/tests.

derks commented 6 years ago

@samlikins this should be better suited now.

Example:

$ vagrant up linux

$ vagrant ssh linux

$ cd /vagrant

$ source env/bin/activate

$ make test
samlikins commented 6 years ago

@derks Those look like some great changes... striping away Python 2 support simplifies the testing environment.