Skip to content

Commit

Permalink
Merge pull request wadobo#95 from Full-Tortuga/feature/EGCETSII#43-ba…
Browse files Browse the repository at this point in the history
…ckend-test

Feature/EGCETSII#43 backend test
  • Loading branch information
JSnow11 authored Jan 9, 2022
2 parents 4362620 + 8314788 commit 93a695c
Show file tree
Hide file tree
Showing 10 changed files with 1,509 additions and 48 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ jobs:

services:
mongodb:
image: mongo:3.4.23
image: mongo
env:
MONGO_INITDB_DATABASE: decide
ports:
- 27017:27017
options: --health-cmd mongo --health-interval 10s --health-timeout 5s --health-retries 5

ldap:
image: carvilgar1us/decideldap
ports:
Expand All @@ -28,7 +32,7 @@ jobs:
- uses: actions/checkout@v2
- name: Install linux dependencies
run: |
sudo apt-get install build-essential python3-dev python2.7-dev libldap2-dev libsasl2-dev tox lcov valgrind
sudo apt-get install build-essential python3-dev python2.7-dev libldap2-dev libsasl2-dev tox lcov valgrind libpq-dev
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand All @@ -37,11 +41,28 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install codacy-coverage
- name: Copy local_settings
run: |
cp ./decide/local_settings.example.py ./decide/local_settings.py
- name: Migrate
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
run: |
cd decide
python manage.py flush --noinput
python manage.py sqlflush
python manage.py makemigrations
python manage.py migrate
- name: Test administration module
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
run: |
python ./decide/manage.py test administration
cd decide
coverage run --branch --source=./administration/ ./manage.py test --settings=decide.test_settings administration --noinput -v 2
coverage xml
- name: Codacy Coverage Reporter
uses: codacy/[email protected]
with:
project-token: ${{ secrets.CODACY_API_TOKEN }}
coverage-reports: decide/coverage.xml
34 changes: 34 additions & 0 deletions .github/workflows/react.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: React CI

on:
push:
branches: [master, main, develop]
pull_request:
branches: [master, main, develop]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
cd decide/administration/frontend &&
npm install
- name: Build app
run: |
cd decide/administration/frontend &&
npm run build --if-present
- name: Test app
run: |
cd decide/administration/frontend &&
npm run test
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[![Decide CI/CD](https://github.com/Full-Tortuga/decide-full-tortuga-autenticacion/actions/workflows/heroku.yml/badge.svg?branch=master)](https://github.com/Full-Tortuga/decide-full-tortuga-autenticacion/actions/workflows/heroku.yml)
[![Build Status](https://travis-ci.com/wadobo/decide.svg?branch=master)](https://travis-ci.com/wadobo/decide) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/94a85eaa0e974c71af6899ea3b0d27e0)](https://www.codacy.com/app/Wadobo/decide?utm_source=github.com&utm_medium=referral&utm_content=wadobo/decide&utm_campaign=Badge_Grade) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/94a85eaa0e974c71af6899ea3b0d27e0)](https://www.codacy.com/app/Wadobo/decide?utm_source=github.com&utm_medium=referral&utm_content=wadobo/decide&utm_campaign=Badge_Coverage)
[![Admin Build CI](https://github.com/Full-Tortuga/decide-full-tortuga-admin/actions/workflows/django.yml/badge.svg?branch=main)](https://github.com/Full-Tortuga/decide-full-tortuga-admin/actions/workflows/django.yml)
[![Admin Frontend CI](https://github.com/Full-Tortuga/decide-full-tortuga-admin/actions/workflows/react.yml/badge.svg?branch=main)](https://github.com/Full-Tortuga/decide-full-tortuga-admin/actions/workflows/react.yml)

[![Test Deployment CD](https://github.com/Full-Tortuga/decide-full-tortuga-admin/actions/workflows/herokuDevelop.yml/badge.svg?branch=main)](https://github.com/Full-Tortuga/decide-full-tortuga-admin/actions/workflows/herokuDevelop.yml)
[![Test Deployment CD](https://github.com/Full-Tortuga/decide-full-tortuga-admin/actions/workflows/herokuMain.yml/badge.svg?branch=main)](https://github.com/Full-Tortuga/decide-full-tortuga-admin/actions/workflows/herokuMain.yml)

[![Codacy Badge](https://app.codacy.com/project/badge/Grade/a9e07b14853a487d82a187bc69365d50)](https://www.codacy.com/gh/Full-Tortuga/decide-full-tortuga-admin/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Full-Tortuga/decide-full-tortuga-admin&utm_campaign=Badge_Grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/a9e07b14853a487d82a187bc69365d50)](https://www.codacy.com/gh/Full-Tortuga/decide-full-tortuga-admin/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Full-Tortuga/decide-full-tortuga-admin&utm_campaign=Badge_Coverage)

Plataforma voto electrónico educativa

Expand Down
12 changes: 6 additions & 6 deletions decide/administration/frontend/src/api/votingApiUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ const votingApi = {

//Individual Operations
getQuestion: (questionId: number) =>
axios.get(`/voting/question/${questionId}/`),
axios.get(`/voting/question/${questionId}`),
createQuestion: (question: votingType.Question) =>
axios.post("/voting/question/", question),
updateQuestion: (question: votingType.Question, questionId: number) =>
axios.put(`/voting/question/${questionId}/`, question),
axios.put(`/voting/question/${questionId}`, question),
deleteQuestion: (questionId: number) =>
axios.delete(`/voting/question/${questionId}/`),
axios.delete(`/voting/question/${questionId}`),

//VOTING API
//Bulk Operations
Expand Down Expand Up @@ -49,12 +49,12 @@ const votingApi = {
}),

//Individual Operations
getVoting: (votingId: number) => axios.get(`/votings/${votingId}/`),
getVoting: (votingId: number) => axios.get(`/votings/${votingId}`),
createVoting: (voting: votingType.VotingFormFields) =>
axios.post("/votings", voting),
updateVoting: (voting: votingType.VotingFormFields, votingId: number) =>
axios.put(`/votings/${votingId}/`, voting),
deleteVoting: (votingId: number) => axios.delete(`/votings/${votingId}/`),
axios.put(`/votings/${votingId}`, voting),
deleteVoting: (votingId: number) => axios.delete(`/votings/${votingId}`),
};

export default votingApi;
Loading

0 comments on commit 93a695c

Please sign in to comment.