GRI-1997: acceptance tests for global and per-campus playback settings, with fallback #179
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!179
Loading…
Reference in a new issue
No description provided.
Delete branch "test/GRI-1997-settings-acceptance-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Acceptance tests for #161, written before the implementation. All 16 tests
are new, live in
crates/server/tests/settings_playback_acceptance_integration.rs,and run against a real Postgres (
SIGNAGE_TEST_DATABASE_URL). No productioncode is touched.
Command
Fail-first
Run against the current, unimplemented code (no
playback_settingstable, no/api/v1/settings/playbackor/api/v1/campuses/{id}/settings/playbackroutes): 0 passed; 16 failed, every failure a 404 (route does not exist
yet) or, for the two existing-global-settings tests, a 200 where a 403 is
required (today's gap). Full output in the test run.
Criterion → test
settings_manageuser →global_put_and_get_succeed_for_an_unscoped_settings_manage_usersettings_manageuser →global_get_is_refused_403_for_a_campus_scoped_settings_manage_usersettings_manageuser →global_put_is_refused_403_for_a_campus_scoped_settings_manage_usersource: "global"→campus_get_with_no_override_returns_the_global_value_and_sourcesource: "campus"→campus_get_after_a_campus_put_returns_the_campus_value_and_sourcenull) falls back to global again →campus_get_after_clearing_the_override_falls_back_to_global_againcampus_get_for_another_campus_is_404_not_403campus_get_for_an_unknown_campus_is_404campus_put_for_another_campus_is_404_not_403campus_put_for_an_unknown_campus_is_404an_unscoped_user_may_read_a_campus_that_is_not_their_ownsettings_manageuser may write a campus that is not their own →an_unscoped_settings_manage_user_may_write_a_campus_that_is_not_their_owndefault_duration_seconds <= 0is400 invalid_duration,nothing written →
a_non_positive_global_duration_is_refused_and_nothing_is_writtendefault_duration_seconds <= 0is400 invalid_duration,nothing written →
a_non_positive_campus_duration_is_refused_and_nothing_is_writtenGET /api/v1/settingsgap: a campus-scopedsettings_manageuser is refused 403 →
a_campus_scoped_settings_manage_user_is_refused_403_from_the_existing_global_settings_getPUT /api/v1/settingsgap: a campus-scopedsettings_manageuser is refused 403 →
a_campus_scoped_settings_manage_user_is_refused_403_from_the_existing_global_settings_putNot in scope here
Writing the migration, the handlers, or the
may_access/403-vs-404 fix incrates/server/src/settings.rs— that is implementation and belongs to theback-end engineer. The proposed contract (route shapes, the 0007 migration,
the 404-not-403 convention) is in the forge issue; flag there if any test
assumes a shape that should change before it's built against.