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

Feature/fix sonar1 #35

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
78ba033
Add analyze sonar
tom-uniandes Nov 3, 2024
a911495
New push
tom-uniandes Nov 3, 2024
d988b87
Add configurations to coverage
tom-uniandes Nov 3, 2024
8cfb081
Add configurations to coverage
tom-uniandes Nov 3, 2024
7a599b2
Add configurations to coverage
tom-uniandes Nov 3, 2024
233f412
Add configurations to coverage
tom-uniandes Nov 3, 2024
f3fcd0f
Add configurations to coverage
tom-uniandes Nov 3, 2024
482bab2
Add configurations to coverage
tom-uniandes Nov 3, 2024
3f5d44d
new push
tom-uniandes Nov 3, 2024
cfb983f
new push
tom-uniandes Nov 3, 2024
f58d9bc
Add configurations to coverage
tom-uniandes Nov 3, 2024
5c32bac
Add configurations to coverage
tom-uniandes Nov 3, 2024
49bb7f0
Add configurations to coverage
tom-uniandes Nov 3, 2024
da47b3a
Add configurations to coverage
tom-uniandes Nov 3, 2024
295cfcb
Add configurations to coverage
tom-uniandes Nov 3, 2024
9d714dd
Add configurations to coverage
tom-uniandes Nov 3, 2024
318bdeb
Add configurations to coverage
tom-uniandes Nov 3, 2024
5c012f0
Add configurations to coverage
tom-uniandes Nov 3, 2024
5fb0a89
Add configurations to coverage
tom-uniandes Nov 3, 2024
7c3d136
Add configurations to coverage
tom-uniandes Nov 3, 2024
32ed5ce
Add configurations to coverage
tom-uniandes Nov 3, 2024
b56d2b7
Add value of test
tom-uniandes Nov 3, 2024
d384cdc
Add sonar
tom-uniandes Nov 3, 2024
8c998e9
Add sonar
tom-uniandes Nov 3, 2024
e6b2fb4
delete file interupt coverage
tom-uniandes Nov 3, 2024
1742b5f
Delete db sqlite
tom-uniandes Nov 3, 2024
2dc4dc9
Fixing unused album id
Nov 4, 2024
5980249
Removing id from function usage also
Nov 4, 2024
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
28 changes: 0 additions & 28 deletions .coveragerc

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Version de Python
run: |
python --version
- name: Instalación de librerías y dependencias
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: pruebas+coverage
id: pruebas
run: |
python -m coverage run -m unittest discover -s tests -v
coverage report
python -m coverage xml -i
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
28 changes: 0 additions & 28 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ src/modelo/__pycache__/*
src/logica/__pycache__/*
src/vista/__pycache__/*
venv/*
tests/__pycache__/*
aplicacion.sqlite
16 changes: 16 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
sonar.projectKey=tom-uniandes_TutorialCancionesTags
sonar.organization=tom-uniandes

sonar.coverage.exclusions=**tests/**,**src/vista/**,**src/recursos/**,**docs/**,**setup.py**
sonar.python.coverage.reportPaths=coverage.xml

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=TutorialCancionesTags
#sonar.projectVersion=1.0


# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
#sonar.sources=.

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
3 changes: 2 additions & 1 deletion src/logica/coleccion.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def __init__(self):

def agregar_album(self, titulo, anio, descripcion, medio):
busqueda = session.query(Album).filter(Album.titulo == titulo).all()
print("prueba")
if len(busqueda) == 0:
album = Album(titulo=titulo, ano=anio, descripcion=descripcion, medio=medio)
session.add(album)
Expand Down Expand Up @@ -147,7 +148,7 @@ def dar_cancion_por_id(self, cancion_id):
def dar_interprete_por_id(self, interprete_id):
return session.query(Interprete).filter_by(id=interprete_id).first().__dict__

def dar_canciones_de_album(self, album_id):
def dar_canciones_de_album(self):
return []

def buscar_canciones_por_titulo(self, cancion_titulo):
Expand Down
4 changes: 2 additions & 2 deletions src/vista/interfaz_coleccion.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def mostrar_ventana_album(self, indice_album):
'''
self.ventana_album.show()
self.ventana_album.mostrar_album(self.logica.dar_album_por_id(indice_album))
self.ventana_album.mostrar_canciones(self.logica.dar_canciones_de_album(indice_album))
self.ventana_album.mostrar_canciones(self.logica.dar_canciones_de_album())

def mostrar_ventana_lista_canciones(self):
'''
Expand Down Expand Up @@ -237,7 +237,7 @@ def asociar_cancion(self, id_album, id_cancion):
'''
self.logica.asociar_cancion(id_cancion, id_album)
self.ventana_album.mostrar_album(self.logica.dar_album_por_id(id_album))
self.ventana_album.mostrar_canciones(self.logica.dar_canciones_de_album(id_album))
self.ventana_album.mostrar_canciones(self.logica.dar_canciones_de_album())

def dar_canciones(self):
'''
Expand Down