A simple game of Battleship, written in Python. The purpose of this repository is to serve as an entry point into coding exercises and it was especially created for scrum.orgs Applying Professional Scrum for Software Development course (www.scrum.org/apssd). The code in this repository is unfinished by design.
This project requires Python 3.6 or newer. To prepare to work with it, pick one of these options:
Create and activate a virtual environment. This assumes python3 is already installed.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
export PYTHONPATH=.
If you stop working on this project, close your shell, and return later, make
sure you run the source bin/venv/activate
command again.
Download and install Python 3.6 for Windows. Make sure python is on
your PATH
. Open a command prompt:
python -m venv venv
venv\Scripts\activate.bat
pip install -r requirements.txt
set PYTHONPATH=.
If you don't want to install anything Python-related on your system, you can run the game inside Docker instead.
docker build -t torpydo .
docker run -it --env PYTHONPATH=/torpydo -v ${PWD}:/torpydo torpydo bash
python -m torpydo
# alternatively:
python torpydo/battleship.py
nose2 -v
behave
to run with coverage:
nose2 -v --with-coverage --coverage ./torpydo
to run and store the test results for further examination (e.g. build pipeline)
nose2 --v --junit-xml --junit-xml-path xunit.xml
behave --junit
Run behave tests with coverage:
https://stackoverflow.com/a/37447392/736079
This application is collecting telemetry data with Microsoft Application Insights. For more details see https://docs.microsoft.com/en-us/azure/azure-monitor/app/opencensus-python.
To send the telemetry data to a specific instance of Application Insights, the connection string has to be adjusted in telemetryclient.py