Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Containerized the Interface and Visualization And Setup Github Actions #63

Merged
merged 48 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a19eab1
Interface & Visualization
im-prakher Jun 25, 2020
db5e430
Delete client.json
im-prakher Jun 25, 2020
397fa29
Delete package-lock.json
im-prakher Jun 26, 2020
cc00650
Update README.md
im-prakher Jun 26, 2020
920545f
Update interface/src/components/upload1.js
im-prakher Jul 1, 2020
f24f0a4
alt text
dlebauer Jul 10, 2020
9674578
Final Changes
im-prakher Jul 18, 2020
3294574
Update upload1.js
im-prakher Jul 19, 2020
0c7da86
Fixed redirects and error page functionality
im-prakher Jul 20, 2020
61297e3
Update app/Meta.py
im-prakher Jul 20, 2020
f11d149
Update app/Meta.py
im-prakher Jul 20, 2020
323291d
Replace "some text" with "" in Meta.py
im-prakher Jul 20, 2020
fde6a05
Written some tests
im-prakher Jul 20, 2020
9ac0073
Completed writing tests
im-prakher Jul 24, 2020
6037b55
Containerized the Interface and Visualiztion
im-prakher Jul 26, 2020
bd5142f
Interface & Visualization
im-prakher Jun 25, 2020
7cb3e19
Update README.md
im-prakher Jun 26, 2020
ee06571
Update interface/src/components/upload1.js
im-prakher Jul 1, 2020
2882ad2
Final Changes
im-prakher Jul 18, 2020
d671211
Containerized the Interface and Visualiztion
im-prakher Jul 26, 2020
1f69728
Merge branch 'master' into containerize
im-prakher Jul 26, 2020
5ad6cae
Merge branch 'containerize' of https://github.com/im-prakher/BETYdb-Y…
im-prakher Jul 26, 2020
30f387a
Merge branch 'containerize' of https://github.com/im-prakher/BETYdb-Y…
im-prakher Jul 26, 2020
c218817
Few changes
im-prakher Jul 26, 2020
4741e29
Merge branch 'master' into containerize
dlebauer Aug 7, 2020
676e63d
Update .gitignore
im-prakher Aug 11, 2020
5affff9
Test not needed
im-prakher Aug 13, 2020
d85a0bf
Set-up Github Actions
im-prakher Aug 13, 2020
d00082f
Fixed typo
im-prakher Aug 13, 2020
d37192c
Fixed typos
im-prakher Aug 13, 2020
ab8668b
Written tests actions in a single file
im-prakher Aug 17, 2020
1564e3d
Pylint fixes
im-prakher Aug 17, 2020
fc73814
Pylint fixes
im-prakher Aug 17, 2020
5e2ec2b
input_files path fixes
im-prakher Aug 17, 2020
4990405
tests fixes
im-prakher Aug 17, 2020
e57ad79
Generated .pylintrc for pylint
im-prakher Aug 21, 2020
db46978
Added env variable for pylint
im-prakher Aug 21, 2020
6b4d33d
setup directory for .pylintrc
im-prakher Aug 21, 2020
7124a27
Implemented python tests using matrix and linter messages_control
im-prakher Aug 23, 2020
da9c3fd
Remove bety sync and typo fixes
im-prakher Aug 23, 2020
3b8166d
Remove unused-import
im-prakher Aug 23, 2020
04e1f6c
Invetigating cause of failing py_tests.yml
im-prakher Aug 25, 2020
8b0b327
Typo fix
im-prakher Aug 25, 2020
d9fc245
Change the ports for visualization
im-prakher Aug 29, 2020
6973dfd
Updated pandas version to 0.24.2
im-prakher Aug 31, 2020
ff4ea61
Removed the containerize branch
im-prakher Sep 3, 2020
9ea8e98
Run actions on pushing commits to any branch
im-prakher Sep 3, 2020
9ec9697
typo fix
im-prakher Sep 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/linters/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ disable=print-statement,
setslice-method,
import-error,
no-absolute-import,
wrong-import-order,
wildcard-import,
no-name-in-module,
old-division,
dict-iter-method,
Expand Down Expand Up @@ -135,7 +137,20 @@ disable=print-statement,
xreadlines-attribute,
deprecated-sys-function,
exception-escape,
comprehension-escape
comprehension-escape,
invalid-name,
broad-except,
superfluous-parens,
missing-module-docstring,
dlebauer marked this conversation as resolved.
Show resolved Hide resolved
missing-class-docstring
missing-function-docstring,
inconsistent-return-statements,
redefined-outer-name,
line-too-long,
bad-continuation,
trailing-newlines,
trailing-whitespace,
bad-whitespace

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/interface_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: YABA app tests

on:
push:
branches: [ master, containerize ]
pull_request:
branches: [ master, containerize ]

jobs:
interface_test:

runs-on: ubuntu-latest
defaults:
run:
working-directory: interface

strategy:
matrix:
node-version: [12.x, 14.x]
dlebauer marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run the tests and generate coverage report
run: npm test -- --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
55 changes: 55 additions & 0 deletions .github/workflows/py_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: YABA app tests

on:
push:
branches: [ master, containerize ]
pull_request:
branches: [ master, containerize ]

jobs:
app_test:

runs-on: ubuntu-latest
strategy:
matrix:
dlebauer marked this conversation as resolved.
Show resolved Hide resolved
code: [ app, client]
include:
- code: app
path: ./yaba_test/test_yaba.py
- code: client
path: ./yaba_client_test/test_yaba_client.py

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: |
pip install --upgrade pip
pip install pytest
pip install pytest-cov
pip install docker-compose

- name: Set-up the project
run: |
docker-compose up -d postgres
docker-compose run --rm bety initialize
docker-compose run --rm bety sync
docker-compose up -d
docker ps -a

- name: Test with pytest and generate coverage report
run: |
sleep 20
pytest --cov= ${{ matrix.path }} --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
108 changes: 0 additions & 108 deletions .github/workflows/tests.yml

This file was deleted.

7 changes: 3 additions & 4 deletions client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
#################

import requests
from flask import Flask, g, render_template,request,redirect,Response,flash,jsonify, make_response
from flask import Flask, render_template,request,redirect,Response,flash
from flask import request

import logging
import json
from time import sleep
import sys
from flask_cors import CORS, cross_origin

from flask_cors import CORS

# Create app
app = Flask(__name__)
Expand Down
26 changes: 13 additions & 13 deletions yaba_client_test/test_yaba_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BasicTests(unittest.TestCase):

def test_insert_experiments(self):
csv_filename = 'experiments.csv'
csv_path = '../input_files/experiments.csv'
csv_path = 'input_files/experiments.csv'
files = {'fileName': open(csv_path, 'rb')}
response = requests.post(
'http://0.0.0.0:6001/experiments?username=guestuser', files=files)
Expand All @@ -20,12 +20,12 @@ def test_insert_experiments(self):

def test_insert_sites(self):
csv_filename = 'sites.csv'
csv_path = '../input_files/'+csv_filename
csv_path = 'input_files/'+csv_filename

shp_file = '../input_files/S8_two_row_polys.shp'
dbf_file = '../input_files/S8_two_row_polys.dbf'
prj_file = '../input_files/S8_two_row_polys.prj'
shx_file = '../input_files/S8_two_row_polys.shx'
shp_file = 'input_files/S8_two_row_polys.shp'
dbf_file = 'input_files/S8_two_row_polys.dbf'
prj_file = 'input_files/S8_two_row_polys.prj'
shx_file = 'input_files/S8_two_row_polys.shx'

files= {'fileName': open(csv_path, 'rb'),
'shp_file': open(shp_file, 'rb'),
Expand All @@ -40,7 +40,7 @@ def test_insert_sites(self):

def test_insert_citations(self):
csv_filename = 'citations.csv'
csv_path = '../input_files/citations.csv'
csv_path = 'input_files/citations.csv'
files = {'fileName': open(csv_path, 'rb')}
response = requests.post(
'http://0.0.0.0:6001/citations?username=guestuser', files=files)
Expand All @@ -49,7 +49,7 @@ def test_insert_citations(self):

def test_insert_treatments(self):
csv_filename = 'treatments.csv'
csv = '../input_files/'+csv_filename
csv = 'input_files/'+csv_filename
files = {'fileName': open(csv, 'rb')}
response = requests.post(
'http://0.0.0.0:6001/treatments?username=guestuser', files=files)
Expand All @@ -58,7 +58,7 @@ def test_insert_treatments(self):

def test_insert_cultivars(self):
csv_filename = 'cultivars.csv'
csv = '../input_files/'+csv_filename
csv = 'input_files/'+csv_filename
files = {'fileName': open(csv, 'rb')}
response = requests.post(
'http://0.0.0.0:6001/cultivars', files=files)
Expand All @@ -67,7 +67,7 @@ def test_insert_cultivars(self):

def test_insert_experimentSites(self):
csv_filename = 'experiments_sites.csv'
csv = '../input_files/'+csv_filename
csv = 'input_files/'+csv_filename
files = {'fileName': open(csv, 'rb')}
response = requests.post(
'http://0.0.0.0:6001/experiments_sites', files=files)
Expand All @@ -76,7 +76,7 @@ def test_insert_experimentSites(self):

def test_insert_experimentTreatments(self):
csv_filename = 'experiments_treatments.csv'
csv = '../input_files/'+csv_filename
csv = 'input_files/'+csv_filename
files = {'fileName': open(csv, 'rb')}
response = requests.post(
'http://0.0.0.0:6001/experiments_treatments', files=files)
Expand All @@ -85,7 +85,7 @@ def test_insert_experimentTreatments(self):

def test_insert_sitesCultivars(self):
csv_filename = 'sites_cultivars.csv'
csv = '../input_files/'+csv_filename
csv = 'input_files/'+csv_filename
files = {'fileName': open(csv, 'rb')}
response = requests.post(
'http://0.0.0.0:6001/sites_cultivars', files=files)
Expand All @@ -94,7 +94,7 @@ def test_insert_sitesCultivars(self):

def test_insert_citationsSites(self):
csv_filename = 'citations_sites.csv'
csv = '../input_files/'+csv_filename
csv = 'input_files/'+csv_filename
files = {'fileName': open(csv, 'rb')}
response = requests.post(
'http://0.0.0.0:6001/citations_sites', files=files)
Expand Down
Loading