Repository navigation
test: cover score timeline and score viewer rows of the release checklist - #678
Merged
Merged
Conversation
…n text "Add annotation" and "Edit annotation" always asked for the text in a dialog. They now take it as an optional argument and only ask when it's missing, like the commands in #671. The toolbar and the shortcuts call them without arguments, so they still ask. Editing to an empty text still asks whether to delete the annotation, whether the empty text was typed or passed.
Adds regression coverage for: creating a score timeline (once or several times) from the menu bar; setting/resetting the color of several selected notes at once; the note keyboard shortcut for delete doing nothing (score components aren't deletable) while Enter opens the inspector; reloading a saved file keeps notes at the same position; importing a score with no beat timeline shows an error; and importing a score then deleting all beats does not crash, degrading metric position to None instead.
Drives the real SvgViewer end to end: toolbar commands via commands.execute(...), keyboard shortcuts via QTest.keyClick, and mouse/wheel input via real Qt events on the view's viewport. Covers annotations (create/delete/edit via shortcut and toolbar, moving with the mouse, clearing to empty with confirm/decline, font size), window lifecycle (close/reopen), and note interaction (click-to-seek, single/multiple selection, zoom in/out). Sidesteps only the MusicXML -> SVG render step (tilia/parsers/score/musicxml_to_svg.py, which drives a QWebEngineView through VexFlow) by loading a hand-built SVG directly through SvgViewer.load_svg_data -- the same method the app calls once that pipeline hands back its result. The selection highlight is checked through the view: the note's patch of the view is grabbed and searched for the red fill that paint() applies while the item is selected, before and after moving the selection. Going through QGraphicsScene.render instead doesn't reproduce that fill. An annotation added through the toolbar lands within a pixel of where it was after a save-and-open round trip, read back from the rebuilt viewer.
FelipeDefensor
force-pushed
the
test/score
branch
from
October 19, 2026 12:18
698588f to
bf8b82f
Compare
Collaborator
Author
|
Squashed to three commits and rebased onto Guarantees of the
With the code in place: 97 passed; full suite ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Score timeline (
tests/ui/timelines/score/test_score_timeline_ui.py):None.Score viewer (
tests/ui/windows/test_svg_viewer.py): these drive the realSvgViewerend to end. Toolbar commands go throughcommands.execute, shortcuts throughQTest.keyClick, and mouse and wheel input through real Qt events on the view's viewport. Only the MusicXML-to-SVG rendering step, which drives aQWebEngineViewthrough VexFlow, is sidestepped: a hand-built SVG is loaded throughSvgViewer.load_svg_data, the method the app calls once that step is done. Covered:SvgStaveNote.paintapplies while it is selected;QGraphicsScene.renderdoesn't reproduce that fill, so it has to go through the view.The rendering itself stays a manual check.
One commit changes the app: the score viewer's "Add annotation" and "Edit annotation" take the text as an optional argument and only ask for it when it's missing, as the commands in #671 do. The toolbar and the shortcuts still ask, and the shortcut tests keep answering that dialog.
These were written against 0.6.5 and rebased onto
dev. Both test files conflicted only wheredevhad added tests at the end of the file; both sides are kept, except one line left over from the oldtest_symbol_staff_collision, whichdevhas since replaced. The viewer fixture now gets its viewer fromget_or_create_svg_view(), because ondevreadingsvg_viewno longer creates one. The tests predate some of TESTING.md's conventions; bringing them in line is left for a separate cleanup PR.Run:
uv run --python 3.12 pytest tests/ui/timelines/score tests/ui/windows/test_svg_viewer.pyRelease-checklist rows: R333, R334, R341, R342, R343, R344, R346, R348, R349, R354, R375, R376, R377, R380, R382, R383, R384, R388, R389, R390, R391, R392, R393, R394. The IDs refer to the checklist copy in tilia-testing (
release-checklist/test-links.csv); the code doesn't mention them.