This guide provides instructions for running tests and executing buildrunner locally during development.
The unit tests use pytest. To run the tests, execute the following commands:
- Clone the buildrunner repository
git clone https://github.com/adobe/buildrunner.git
- Navigate to the root of the buildrunner repository
- Setup virtual environment
python -m venv venv
source venv/bin/activate
- Install requirements
pip install -r requirements.txt
- Install test requirements
pip install -r test_requirements.txt
Run the tests
Run all the tests by typing pytest
pytest
To run a specific test file, provide the path to the file
pytest tests/test_buildrunner.py
To run buildrunner locally in the buildrunner directory it is best to use the run-buildrunner.sh script. This ensures that the latest local changes are used when running buildrunner. The examples/ directory contains example buildrunner configuration files that can be used to test the functionality of buildrunner. To use this script follow these steps:
- Clone the buildrunner repository
git clone https://github.com/adobe/buildrunner.git
- Navigate to the root of the buildrunner repository
- Setup virtual environment
python -m venv venv
source venv/bin/activate
- Install requirements
pip install -r requirements.txt
- Run the script
./run-buildrunner.sh -f examples/build/basic/buildrunner.yaml
It is also possible to install and run a working version of buildrunner in another repository. To do this, follow these steps:
- Clone the buildrunner repository
git clone https://github.com/adobe/buildrunner.git
- Navigate to the root of the desired repository
- Setup virtual environment
python -m venv venv
source venv/bin/activate
- Install buildrunner
pip install ..</path/to>/buildrunner
- Reactivate the virtual environment
deactivate
source venv/bin/activate
- Run buildrunner
buildrunner --help
Note
You can verify that you are using the correct buildrunner by typing which buildrunner
and ensuring that the path is to the virtual environment (i.e. venv/
).