From 5b74b9f9003b9b504be2283d91ab8ee786ee82ff Mon Sep 17 00:00:00 2001 From: kgvrmohan26 <86909924+kgvrmohan26@users.noreply.github.com> Date: Fri, 24 Sep 2021 03:41:49 -0400 Subject: [PATCH 1/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 48be970..bf5a096 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![codecov](https://codecov.io/gh/PGCSEDS-IIITH/devsecops-iris/branch/master/graph/badge.svg?token=EILEH8L7R5)](https://codecov.io/gh/PGCSEDS-IIITH/devsecops-iris) -This repository contains code which demonstrates Dev-Sec-Ops using a `FastAPI` application which predicts the flower class using the IRIS dataset (https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html) +This repository contains code which demonstrates Dev-Sec-Ops using a `FastAPI` application which predicts the flower class using the IRIS dataset (https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html). ## Running Instructions - Create a fork of the repo using the `fork` button. @@ -25,4 +25,4 @@ This repository contains code which demonstrates Dev-Sec-Ops using a `FastAPI` a - Make a visualisation for sarif report using any tool. upload screenshot, image, html or pdf. Add it to the reports/ folder. ## Submission -- Link to github repository as a comment on the submission (olympus portal). [uploading .txt is optional] \ No newline at end of file +- Link to github repository as a comment on the submission (olympus portal). [uploading .txt is optional] From d8903462e45009dae4b8e96283db169f3271b66a Mon Sep 17 00:00:00 2001 From: kgvrmohan26 <86909924+kgvrmohan26@users.noreply.github.com> Date: Fri, 24 Sep 2021 04:57:05 -0400 Subject: [PATCH 2/5] Update README.md Added git url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf5a096..47e8f18 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository contains code which demonstrates Dev-Sec-Ops using a `FastAPI` a ## Running Instructions - Create a fork of the repo using the `fork` button. -- Clone your fork using `git clone https://www.github.com//mlops-iris.git` +- Clone your fork using `git clone https://github.com/kgvrmohan26/devsecops-iris.git` - Install dependencies using `pip3 install -r requirements.txt` - Run application using `python3 main.py` - Run tests using `pytest` From b02a5ee549f104359f17c9b4605e31f856810614 Mon Sep 17 00:00:00 2001 From: kgvrmohan26 Date: Fri, 24 Sep 2021 05:27:53 -0400 Subject: [PATCH 3/5] [Update] Changed Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 47e8f18..10d077b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository contains code which demonstrates Dev-Sec-Ops using a `FastAPI` a ## Running Instructions - Create a fork of the repo using the `fork` button. -- Clone your fork using `git clone https://github.com/kgvrmohan26/devsecops-iris.git` +- Clone your fork using `git clone https://github.com/kgvrmohan26/devsecops-iris.git`.. - Install dependencies using `pip3 install -r requirements.txt` - Run application using `python3 main.py` - Run tests using `pytest` From f52849feab4d603954bc6f6a22757dae1d197f12 Mon Sep 17 00:00:00 2001 From: kgvrmohan26 Date: Fri, 24 Sep 2021 05:41:17 -0400 Subject: [PATCH 4/5] [Update] Changed Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 10d077b..c48b9b0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Dev-Sec-Ops Demo/Assignment -[![codecov](https://codecov.io/gh/PGCSEDS-IIITH/devsecops-iris/branch/master/graph/badge.svg?token=EILEH8L7R5)](https://codecov.io/gh/PGCSEDS-IIITH/devsecops-iris) +[![codecov](https://app.codecov.io/gh/kgvrmohan26/devsecops-iris/branch/master/graph/badge.svg?token=EILEH8L7R5)](https://app.codecov.io/gh/kgvrmohan26/devsecops-iris) This repository contains code which demonstrates Dev-Sec-Ops using a `FastAPI` application which predicts the flower class using the IRIS dataset (https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html). From c1b6861d0ca05e1fae801a3a5074d20a40426ea8 Mon Sep 17 00:00:00 2001 From: kgvrmohan26 Date: Sat, 25 Sep 2021 14:20:38 -0400 Subject: [PATCH 5/5] [Update] Changed pytest --- main.py | 2 +- test_app.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 231b997..395126f 100644 --- a/main.py +++ b/main.py @@ -30,7 +30,7 @@ class FeedbackIn(BaseModel): sepal_width: float petal_length: float petal_width: float - flower_class: str + flower_class: str='Iris Setosa' # Route definitions diff --git a/test_app.py b/test_app.py index b65fc90..cf215d6 100644 --- a/test_app.py +++ b/test_app.py @@ -24,3 +24,19 @@ def test_pred_virginica(): # asserting the correct response is received assert response.status_code == 200 assert response.json() == {"flower_class": "Iris Virginica"} + +# test to check if Iris Virginica is classified correctly +def test_retrain(): + # defining a sample payload for the testcase + payload = { + "sepal_length": 0, + "sepal_width": 0, + "petal_length": 0, + "petal_width": 0, + "flower_class": 'Iris Setosa' + } + with TestClient(app) as client: + response = client.post("/feedback_loop", json=payload) + # asserting the correct response is received + #assert response.status_code == 200 + #assert response.json() == {"flower_class": "Iris Virginica"}