MarketSquare / MarketSquare/Robotframework-Database-Library
New keyword "Compare Query Results"
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 179
- Fork
- 178
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
The keyword should compare results of two SQL queries and show the difference.
The arguments would be like ``query_1``, ``query_2`` and ``assert_results_equal`` (_True_ or _False_).
If _False_, there is no assertion - just show print the difference in the RF log.
Both queries must deliver the same columns - same numbers and the same names.
It has to be implemented in the queries themselves.
## The output should look like a merged table
- The columns are the same, they're merged (no duplicated cols like _Col_A_Query_1_ and _Col_A_Query_2_ - just _Col_A_).
- The cells with not equal values should get a red background and contain both values like ``Value 1 != Value 2``.
- The column name and the row number with a cell with unequal values shall be highlighted as well.
- And maybe keep them visible during the scrolling (sticky scroll)?
- All other cells with equal values should be either not highlighted at all or get a green background maybe.
## Apart from the visual highlighting, there should be an assertion to provide the keyword status and the error message
- The error message should not include all details, but maybe a number of rows and column names? Like this: _X rows had differences in cols A, B and C_?
## The very first check though should be the comparison of row number in results
- If they are unequal, there should be an error message (without details) - and an additional visual output.
- Visually, it would be maybe nice to print both tables aside and highlight rows, which exist in one of the results only - in green and red, like git merge style?
- No further assertions are performed in this case.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
L’issue non indica file, test o punti di ingresso. Inizia individuando le parole chiave esistenti relative alle query e i relativi test, quindi chiarisci l’ordinamento delle righe, le discrepanze nel numero di righe, la formattazione dell’output e il comportamento delle asserzioni. Il lavoro è completo quando la parola chiave di confronto, la segnalazione degli errori e l’output visivo delle differenze hanno un comportamento definito per risultati uguali e diversi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python, sql
- Ambito
- database, testing
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100