From 17690607f5a840a6d4f75755c45069c5e6d83b85 Mon Sep 17 00:00:00 2001 From: mayura_andrew <48531182+mayura-andrew@users.noreply.github.com> Date: Thu, 15 Jun 2023 16:09:05 +0530 Subject: [PATCH 1/3] Create ci_cd_wf.yml --- .github/workflows/ci_cd_wf.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/ci_cd_wf.yml diff --git a/.github/workflows/ci_cd_wf.yml b/.github/workflows/ci_cd_wf.yml new file mode 100644 index 00000000..29a4a145 --- /dev/null +++ b/.github/workflows/ci_cd_wf.yml @@ -0,0 +1,29 @@ +name: test + +on: + push: + branches: + - main + pull_request: + branches: + - "*" + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Check out repo code + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.x" + + - name: Install Dependencies + run: | + python -m pip install -r requirements.txt + - name: Run tests + run: | + python -m pytest -v tests From e495085643c65ad7adb3a5a920198bf6299fee52 Mon Sep 17 00:00:00 2001 From: mayura-andrew Date: Thu, 15 Jun 2023 16:14:38 +0530 Subject: [PATCH 2/3] changed test_add to fail --- .vscode/settings.json | 6 ++++++ tests/test_calculator.py | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..9ee86e71 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "[python]": { + "editor.defaultFormatter": "ms-python.autopep8" + }, + "python.formatting.provider": "none" +} \ No newline at end of file diff --git a/tests/test_calculator.py b/tests/test_calculator.py index e69de29b..7369c462 100644 --- a/tests/test_calculator.py +++ b/tests/test_calculator.py @@ -0,0 +1,3 @@ +def test_add(): + assert add(1,1) == 0 + \ No newline at end of file From ed897770e164fd8efed66ca2b103a220d88d9ff3 Mon Sep 17 00:00:00 2001 From: mayura-andrew Date: Thu, 15 Jun 2023 16:17:32 +0530 Subject: [PATCH 3/3] changed test_add to success --- tests/test_calculator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_calculator.py b/tests/test_calculator.py index 7369c462..44117c96 100644 --- a/tests/test_calculator.py +++ b/tests/test_calculator.py @@ -1,3 +1,2 @@ def test_add(): - assert add(1,1) == 0 - \ No newline at end of file + assert add(1,1) == 2