From fa3808c976afb4a187373ebc7971f3c2ed98ee0c Mon Sep 17 00:00:00 2001 From: Himol Shah Date: Thu, 1 Oct 2020 11:44:43 -0400 Subject: [PATCH 01/10] Creates PLAN2.md --- PLAN_OF_ACTION.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 PLAN_OF_ACTION.md diff --git a/PLAN_OF_ACTION.md b/PLAN_OF_ACTION.md new file mode 100644 index 00000000..181ea1ed --- /dev/null +++ b/PLAN_OF_ACTION.md @@ -0,0 +1,16 @@ +1. Create an interface to run "TeamAssigner.py" after entering new member and project details. Currently, this needs to be done explicitly from the terminal. +2. Currently, "TeamAssigner.py" executes for all the members (new and old). Realistic scenario will be to run the algorithm for new members only. Therefore, update "TeamAssigner.py" for the same. +3. Provide State Management to ensure that the URLs will be accessed only after a particular action is executed. As for an example "/success" should be accessible only after form submit has been performed and not otherwise. +4. Use ORM instead of raw SQL queries for the backend. +5. Wrap the code and create a package so that the entire application can be downloaded from some standard package manager (eg. pip). +6. Dockerise the application. +7. Hosting the website on to AWS. +8. Improve error handling to display relevant error messages instead of generic error messages on the front end. +9. Include test cases for frontend and backend testing as well as end-to-end testing. +10. Call the test suite from .travis.yml. +11. Create end-to-end flow by integrating separate code chunks of NodeJs, JavaScript and Flask. + + + + + From 9684ee871be4408420de5ac6f7849c25f5b8cf83 Mon Sep 17 00:00:00 2001 From: Tanvi Pandit Date: Thu, 1 Oct 2020 11:54:36 -0400 Subject: [PATCH 02/10] Update PLAN_OF_ACTION.md --- PLAN_OF_ACTION.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/PLAN_OF_ACTION.md b/PLAN_OF_ACTION.md index 181ea1ed..bf9a17d7 100644 --- a/PLAN_OF_ACTION.md +++ b/PLAN_OF_ACTION.md @@ -7,10 +7,7 @@ 7. Hosting the website on to AWS. 8. Improve error handling to display relevant error messages instead of generic error messages on the front end. 9. Include test cases for frontend and backend testing as well as end-to-end testing. -10. Call the test suite from .travis.yml. +10. Continuous testing using TRAVIS 11. Create end-to-end flow by integrating separate code chunks of NodeJs, JavaScript and Flask. - - - - - +12. Restructure the code to logically seperate different sections in the code base +13. Add syntax checkers, linters, code formatters, remove redundant files from gitignore, add more badges From 4b2b65f5fd63863a5e1defc8c6d70442b8cf84aa Mon Sep 17 00:00:00 2001 From: KrisshaJ <35404860+KrisshaJ@users.noreply.github.com> Date: Fri, 2 Oct 2020 02:05:33 -0400 Subject: [PATCH 03/10] Modified travis.yml --- .travis.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 41e17cda..d4b269d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,8 @@ -language: node_js -node_js: - - 12.18.3 -cache: npm - +language: python +python: + - "3.6" + - "3.7" install: - - npm ci + - pip install -r requirements.txt script: - - npm test - - npm run build -deploy: - provider: pages - skip-cleanup: true - github-token: $GITHUB_TOKEN - local_dir: build - on: - branch: master \ No newline at end of file + - python -m pytest From eda8d2945c0012e7362b4702ac13b3f192937c47 Mon Sep 17 00:00:00 2001 From: KrisshaJ <35404860+KrisshaJ@users.noreply.github.com> Date: Fri, 2 Oct 2020 02:07:46 -0400 Subject: [PATCH 04/10] Create requirements.txt --- requirements.txt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..04c322ad --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +click==7.1.2 +Flask==1.1.2 +Flask-Cors==3.0.9 +itsdangerous==1.1.0 +Jinja2==2.11.2 +MarkupSafe==1.1.1 +six==1.15.0 +Werkzeug==1.0.1 +pandas From 75e75d2bf9298231979760dc5b341c577d4f77f5 Mon Sep 17 00:00:00 2001 From: KrisshaJ <35404860+KrisshaJ@users.noreply.github.com> Date: Fri, 2 Oct 2020 02:09:07 -0400 Subject: [PATCH 05/10] Create a test file --- tests/test1.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/test1.py diff --git a/tests/test1.py b/tests/test1.py new file mode 100644 index 00000000..ed4a4496 --- /dev/null +++ b/tests/test1.py @@ -0,0 +1 @@ +assert 1==1 From ea45ed8d74ed8cb884ff3eb314fa947a7bbf7323 Mon Sep 17 00:00:00 2001 From: Amit Mandliya Date: Fri, 2 Oct 2020 02:49:40 -0400 Subject: [PATCH 06/10] Updated travis badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e0969c6..45af8796 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/lokesh45/TeamFormationAssistant.svg?branch=master)](https://travis-ci.org/lokesh45/TeamFormationAssistant) +[![Build Status](https://travis-ci.org/AmitMandliya/TeamFormationAssistant.svg?branch=master)](https://travis-ci.org/AmitMandliya/TeamFormationAssistant) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8475.svg)](https://doi.org/10.5281/zenodo.8475) # Team Formation Assistant ## Problem Statement From 056b83cc055c29f2e48194cb3db32ae5e9be0ccc Mon Sep 17 00:00:00 2001 From: KrisshaJ <35404860+KrisshaJ@users.noreply.github.com> Date: Sat, 10 Oct 2020 00:08:59 -0400 Subject: [PATCH 07/10] Update and rename test1.py to test_TeamAssigner.py --- tests/{test1.py => test_TeamAssigner.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{test1.py => test_TeamAssigner.py} (100%) diff --git a/tests/test1.py b/tests/test_TeamAssigner.py similarity index 100% rename from tests/test1.py rename to tests/test_TeamAssigner.py From 446648e681066a3fac4aafda3b194350f3da7aac Mon Sep 17 00:00:00 2001 From: KrisshaJ <35404860+KrisshaJ@users.noreply.github.com> Date: Sat, 10 Oct 2020 00:11:38 -0400 Subject: [PATCH 08/10] Updated test file --- tests/test_TeamAssigner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_TeamAssigner.py b/tests/test_TeamAssigner.py index ed4a4496..aaa2a9cd 100644 --- a/tests/test_TeamAssigner.py +++ b/tests/test_TeamAssigner.py @@ -1 +1,5 @@ -assert 1==1 +import warnings +import pytest + +def test(): + assert 1 == 1 From 8a6c53cad0d20788dc44e65e5693b80be8bc289e Mon Sep 17 00:00:00 2001 From: Amit Mandliya Date: Mon, 12 Oct 2020 19:53:00 -0400 Subject: [PATCH 09/10] added first react test --- package.json | 5 ++++- src/frontend_tests/Signup.test.js | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/frontend_tests/Signup.test.js diff --git a/package.json b/package.json index a229c256..b72d5fbe 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,14 @@ "private": true, "dependencies": { "@testing-library/jest-dom": "^4.2.4", - "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^7.2.1", "axios": "^0.20.0", + "body-parser": "^1.19.0", + "cors": "^2.8.5", "express": "^4.17.1", "faker": "^5.1.0", "lodash.samplesize": "^4.2.0", + "mysql": "^2.18.1", "mysql2": "^2.2.2", "react": "^16.13.1", "react-bootstrap": "^1.3.0", @@ -43,6 +45,7 @@ ] }, "devDependencies": { + "@testing-library/react": "^9.5.0", "gh-pages": "^3.1.0" } } diff --git a/src/frontend_tests/Signup.test.js b/src/frontend_tests/Signup.test.js new file mode 100644 index 00000000..83bea09d --- /dev/null +++ b/src/frontend_tests/Signup.test.js @@ -0,0 +1,5 @@ +import Signup from '../Signup.js'; + +test('First test',() => { + expect(true).toBeTruthy(); +}) \ No newline at end of file From 357135ef617dc0737203a68c3991ac8834b97b5f Mon Sep 17 00:00:00 2001 From: Amit Mandliya Date: Mon, 12 Oct 2020 20:55:33 -0400 Subject: [PATCH 10/10] signup test suite extended --- src/frontend_tests/Signup.test.js | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/frontend_tests/Signup.test.js b/src/frontend_tests/Signup.test.js index 83bea09d..a0e0b7b0 100644 --- a/src/frontend_tests/Signup.test.js +++ b/src/frontend_tests/Signup.test.js @@ -1,5 +1,24 @@ import Signup from '../Signup.js'; +import React from 'react'; +import renderer from 'react-test-renderer'; +import { BrowserRouter } from 'react-router-dom'; + +test('snapshot headjs renders', () => { + const component = renderer.create(); + let tree = component.toJSON(); + expect(tree).toMatchSnapshot(); +}); + + +test('snapshot midpart renders', () => { + const component = renderer.create(); + let tree = component.toJSON(); + expect(tree).toMatchSnapshot(); +}); + +test('snapshot formblock renders', () => { + const component = renderer.create(); + let tree = component.toJSON(); + expect(tree).toMatchSnapshot(); +}); -test('First test',() => { - expect(true).toBeTruthy(); -}) \ No newline at end of file