nyu-devops-summer-2021-inventory / inventories

The inventory resource keeps track of how many of each product we have in our warehouse.
1 stars 0 forks source link

NYU DevOps Inventory Service (Summer 2021)

Build Status codecov

Introduction

The inventory resource keeps track of how many of each product we have in our warehouse. It also includes details like SKU, restock levels, restock amounts, the condition of items, and whether or not an item is considered in-stock.

Installation of Vagrant, VirtualBox and Docker

The easiest way to develop this service is with Vagrant and VirtualBox (or if you're using an M1 MacBook, Docker).

If you don't have this software the first step is down download and install it.

Here is what you need:

Once you've installed these dependencies, you're ready to clone the repository and start developing!

Developing Locally Using Vagrant

git clone https://github.com/nyu-devops-summer-2021-inventory/inventories.git
cd inventories
vagrant up

Connecting to the Development Environment

You can now ssh into the virtual machine and run the service and the test suite:

vagrant ssh
cd /vagrant

You will now be inside the Linux virtual machine so all commands will be Linux commands.

Manually running the Tests

Always run the test cases first!

First run the unit tests using nosetests:

$ nosetests

Then run the integration tests using behave:

$ honcho start &
$ behave

We've also include pylint in the requirements.txt. If you use a programmer's editor like VS Code you can install plug-ins that will use pylint while you are editing. This catches a lot of errors while you code that would normally be caught at runtime. It's a good idea to always code with pylint active.

When you are done, you can exit and shut down the vm with:

$ exit
$ vagrant halt

If the VM is no longer needed you can remove it with:

$ vagrant destroy

Make calls to our services