This pull request includes significant changes to the development and testing setup, as well as some updates to the combat feature in the application. The most important changes include the addition of a new development Dockerfile, modifications to the CI workflow to include test execution, and the introduction of behavior-driven development (BDD) tests for combat scenarios.
Development and Testing Setup:
New Development Dockerfile: Added Dockerfile.dev to set up a development environment with necessary dependencies and a script to run tests. (Dockerfile.dev)
CI Workflow Update: Modified the CI workflow to include a step for running tests using the new development Dockerfile. (.github/workflows/ci.yml)
Compose File for Development: Added compose.dev.yml to define services for the development environment, including a backend service and a MongoDB service. (compose.dev.yml)
Test Execution Script: Introduced run_tests.sh to execute both pytest and behave tests. (run_tests.sh)
Application Code Changes:
Optional Password Field: Updated the Player model to make the password field optional. (src/app/models/player.py)
Debugging Print Statement: Added a print statement for debugging purposes in the use_ability method of CombatService. (src/app/services/combat_service.py)
Behavior-Driven Development (BDD) Tests:
Combat Feature Scenarios: Added BDD scenarios for combat, including starting combat, attacking an enemy, and defending. (src/features/combat.feature)
Combat Step Definitions: Implemented step definitions for the combat feature using behave and pytest. (src/features/steps/combat_steps.py)
Miscellaneous:
MongoDB Initialization: Corrected the import statements in the MongoDB initialization file. (src/app/database/mongo/__init__.py, src/app/database/mongo/_init_.py) [1][2]
Pytest Configuration: Configured pytest to use asyncio mode automatically. (src/tests/conftest.py)
This pull request includes significant changes to the development and testing setup, as well as some updates to the combat feature in the application. The most important changes include the addition of a new development Dockerfile, modifications to the CI workflow to include test execution, and the introduction of behavior-driven development (BDD) tests for combat scenarios.
Development and Testing Setup:
Dockerfile.dev
to set up a development environment with necessary dependencies and a script to run tests. (Dockerfile.dev
).github/workflows/ci.yml
)compose.dev.yml
to define services for the development environment, including a backend service and a MongoDB service. (compose.dev.yml
)run_tests.sh
to execute bothpytest
andbehave
tests. (run_tests.sh
)Application Code Changes:
Player
model to make thepassword
field optional. (src/app/models/player.py
)use_ability
method ofCombatService
. (src/app/services/combat_service.py
)Behavior-Driven Development (BDD) Tests:
src/features/combat.feature
)behave
andpytest
. (src/features/steps/combat_steps.py
)Miscellaneous:
src/app/database/mongo/__init__.py
,src/app/database/mongo/_init_.py
) [1] [2]pytest
to use asyncio mode automatically. (src/tests/conftest.py
)