🚀 Rocket 2¶
Rocket 2 is a from-the-ground-up rebuild of Rocket, UBC Launch Pad’s in-house management Slack bot.
Developer Installation¶
We use pipenv for dependency management.
git clone https://github.com/ubclaunchpad/rocket2.git
cd rocket2/
pip install pipenv
pipenv install --dev
pipenv
will manage a virtualenv,
so interacting with the program or using the development tools has to be done
through pipenv, like so:
pipenv run pycodestyle .
This can get inconvenient, so you can instead create a shell that runs in the managed environment like so:
pipenv shell
and then commands like pycodestyle
and pytest
can be run like normal.
Additionally, we use Github Actions as a CI system. To run the same checks
locally, we provide scripts/build_check.sh
; this can be run with:
./scripts/build_check.sh
The above tests would be run with the assumption that other applications, such as a local instance of DynamoDB, is also running. To run tests that explicitly do not involve the running of any database, run pytest with the following arguments:
pytest -m "not db"
You can also install it as a pre-commit hook for git:
cd scripts/
make install
Note that testing alongside a real Slack workspace, DynamoDB, and so on requires quite a bit more setup. For a full guide to developer installation, see our local development guide.
Running DynamoDB Locally¶
Some tests assume the existence of a local DynamoDB database. These are primarily for automated testing, like on Github Actions CI, but if you would like to run them yourself or are developing new tests, you can run as follows:
wget https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz
mkdir DynamoDB
tar -xvf dynamodb_local_latest.tar.gz --directory DynamoDB
# Configure AWS
scripts/setup_localaws.sh
# Run DynamoDB through Java
cd DynamoDB/
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
# Open a new terminal to continue interacting
For a more sandboxed approach, you can use Docker and docker-compose to spin up a local DynamoDB instance:
docker-compose -f sandbox.yml up
You can then point a Rocket instance at this DynamoDB database by setting
AWS_LOCAL=True
.