This repository contains pytests for a new training algorithm for regression with the NewTrainer
abstract interface and Its implementation LinearRegression
class on completing the screening exercise of "Testing infrastructure for VowpalWabbit" RLOSF 2023 Project.
Submitted by: Mohamed Awnallah mohamedmohey2352@gmail.com
Let’s say we have just implemented a new training algorithm for regression with the following interface:
class NewTrainer:
...
def train(self, x: List[List[float]], y: List[float]):
...
def predict(self, x: List[float]) -> float:
...
return 0
Design and write test suite for it in Python using unittest or pytest frameworks.
First clone the project using this command:
git clone https://github.com/mhmdawnallah/RLOSF-Screening-Exercise-Testing-Infrastructure-for-VowpalWabbit.git
cd RLOSF-Screening-Exercise-Testing-Infrastructure-for-VowpalWabbit
Then install the following the following dependencies using this command:
pip install -r requirements.txt
To run the tests, use the following command from the root directory:
export PYTHONPATH=$PYTHONPATH:$PWD/src
pytest -v
The latest testing report could be found here.
Although CI/CD (Continous Integration/Continous Deployment) workflow is not required in the screening exercise in Testing Infrastructure for VowalWabbit
, I'd like to take it a step further and integrate the testing of the linear regression machine learning with GitHub actions. Additionally, GitHub pages will be used to display Allure testing report and README documentation.
Here is the CI/CD Workflow diagram:
project/
│
├── github/workflows/
│ └── ci_cd.yml # Continous Integration and Deployment Workflow using GitHub Actions
│
├── src/
│ ├── linear_regression.py # Linear Regression Class which is the implementation of NewTrainer Abstract Interface
│ └── new_trainer.py # NewTrainer Abstract Interface for regression algorithms implementation
│
├── tests/
│ └── test_linear_regression.py # Test suit for Linear Regression
├── requirements.txt
├── README.md
└── .gitignore