Skip to content

Commit

Permalink
Adjust fixtures for modified constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
owi92 committed Apr 26, 2024
1 parent 4bc8e92 commit d10fdbb
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 29 deletions.
4 changes: 2 additions & 2 deletions backend/src/db/tests/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl TestDb {
) -> Result<Key> {
let sql = "insert into events
(state, opencast_id, title, series, is_live, read_roles, write_roles, created,
updated, metadata, duration, tracks, captions)
updated, metadata, duration, tracks, captions, segments)
values
('ready', $1, $2, $3, false, '{ROLE_ANONYMOUS}', '{ROLE_ANONYMOUS}',
now(), now(), '{}', $4,
Expand All @@ -100,7 +100,7 @@ impl TestDb {
'{1280, 720}',
true
)]::event_track[],
'{}'
'{}', '{}'
)
returning id";

Expand Down
34 changes: 23 additions & 11 deletions frontend/tests/fixtures/standard.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ values ('waiting', '2b814c02-c849-4553-b5f5-f4e9e69fd74f', null, null, '-infinit
-- player should only use videos where it fits.

insert into events (state, opencast_id, title, description, creators, metadata, series, part_of, duration, is_live,
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions)
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions, segments)
values ('ready', 'aaa12fa0-95f8-4722-84d7-4fac5e59a572', 'Video of a Tabby Cat',
'A nice cat captured with a narrow depth of field.\n\nKindly uploaded by Gustavo Belemmi with a very permissive license.',
'{"Gustavo Belemmi"}',
Expand All @@ -53,11 +53,12 @@ values ('ready', 'aaa12fa0-95f8-4722-84d7-4fac5e59a572', 'Video of a Tabby Cat',
row('http://localhost:38456/cat-bokeh-no-audio-x264-240p.mp4',
'presenter/preview', 'video/mp4', '{432, 240}', true)
]::event_track[],
'{}',
'{}'
);

insert into events (state, opencast_id, title, description, creators, metadata, series, part_of, duration, is_live,
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions)
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions, segments)
values ('ready', '2784521d-d10a-4a27-a77c-cd3f557259c2', 'Black Cat (protected)',
'Secret kitty hihi',
'{"klimkin"}',
Expand All @@ -73,12 +74,13 @@ values ('ready', '2784521d-d10a-4a27-a77c-cd3f557259c2', 'Black Cat (protected)'
row('http://localhost:38456/cat-black-x264-240p.mp4',
'presentation/preview', 'video/mp4', '{432, 240}', true)
]::event_track[],
'{}',
'{}'
);

-- Dual stream public
insert into events (state, opencast_id, title, description, creators, metadata, series, part_of, duration, is_live,
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions)
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions, segments)
values ('ready', '172d4ec3-4e58-48b4-bdf0-85909a32439d', 'Dual Stream Cats',
null,
'{"Gustavo Belemmi", "klimkin"}',
Expand All @@ -98,12 +100,13 @@ values ('ready', '172d4ec3-4e58-48b4-bdf0-85909a32439d', 'Dual Stream Cats',
row('http://localhost:38456/cat-black-x264-240p.mp4',
'presentation/preview', 'video/mp4', '{432, 240}', false)
]::event_track[],
'{}',
'{}'
);

-- Planned event
insert into events (state, opencast_id, title, description, creators, metadata, series, part_of, duration, is_live,
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions)
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions, segments)
values ('ready', '9dc41ccb-4a54-498f-98cf-98ca455f708c', 'Far in the Future',
null,
'{"Peter Lustig"}',
Expand All @@ -119,12 +122,13 @@ values ('ready', '9dc41ccb-4a54-498f-98cf-98ca455f708c', 'Far in the Future',
row('http://localhost:38456/cat-black-x264-240p.mp4',
'presentation/preview', 'video/mp4', '{432, 240}', true)
]::event_track[],
'{}',
'{}'
);

-- Live event
insert into events (state, opencast_id, title, description, creators, metadata, series, part_of, duration, is_live,
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions)
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions, segments)
values ('ready', 'b5d4533f-0ddd-4dd2-aa64-de24d3b20d72', 'Currently live!!',
null,
'{"Die Maus"}',
Expand All @@ -138,12 +142,13 @@ values ('ready', 'b5d4533f-0ddd-4dd2-aa64-de24d3b20d72', 'Currently live!!',
row('http://localhost:38456/cat-black-x264-144p.mp4',
'presentation/preview', 'video/mp4', '{256, 144}', true)
]::event_track[],
'{}',
'{}'
);

-- Past Live event
insert into events (state, opencast_id, title, description, creators, metadata, series, part_of, duration, is_live,
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions)
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions, segments)
values ('ready', 'd5af7441-e9a3-4a1f-a58d-1116b899c693', 'Past live event',
null,
'{"Hubert"}',
Expand All @@ -157,12 +162,13 @@ values ('ready', 'd5af7441-e9a3-4a1f-a58d-1116b899c693', 'Past live event',
row('http://localhost:38456/cat-black-x264-144p.mp4',
'presentation/preview', 'video/mp4', '{256, 144}', true)
]::event_track[],
'{}',
'{}'
);

-- Private video
insert into events (state, opencast_id, title, description, creators, metadata, series, part_of, duration, is_live,
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions)
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions, segments)
values ('ready', '7205a608-08bc-44fc-af8d-65578697c625', 'Very secret private video',
null,
'{"Anon"}',
Expand All @@ -176,12 +182,13 @@ values ('ready', '7205a608-08bc-44fc-af8d-65578697c625', 'Very secret private vi
row('http://localhost:38456/scifi-tunnel-no-audio-x264-144p.mp4',
'presentation/preview', 'video/mp4', '{256, 144}', true)
]::event_track[],
'{}',
'{}'
);

-- Portrait video
insert into events (state, opencast_id, title, description, creators, metadata, series, part_of, duration, is_live,
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions)
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions, segments)
values ('ready', '2e5b56da-695d-4be8-b557-7f0fba51ca24', 'Portait video of a train',
null,
'{"Joachim Rübe"}',
Expand All @@ -195,12 +202,13 @@ values ('ready', '2e5b56da-695d-4be8-b557-7f0fba51ca24', 'Portait video of a tra
row('http://localhost:38456/train-portrait-x264.mp4',
'presentation/preview', 'video/mp4', '{256, 144}', true)
]::event_track[],
'{}',
'{}'
);

-- 1h+ video
insert into events (state, opencast_id, title, description, creators, metadata, series, part_of, duration, is_live,
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions)
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions, segments)
values ('ready', '1c5d5e89-76b7-4d81-a316-ef62b470e13d', 'Long boy',
null,
'{"Joachim Rübe"}',
Expand All @@ -214,11 +222,12 @@ values ('ready', '1c5d5e89-76b7-4d81-a316-ef62b470e13d', 'Long boy',
row('http://localhost:38456/train-portrait-x264.mp4',
'presentation/preview', 'video/mp4', '{256, 144}', true)
]::event_track[],
'{}',
'{}'
);

insert into events (state, opencast_id, title, description, creators, metadata, duration, is_live,
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions)
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions, segments)
values ('ready', '0637a85a-c360-450b-900d-81f423cb21f3', 'Unlisted video without series',
'Unlisted video being alone',
'{"Stanley"}',
Expand All @@ -233,11 +242,12 @@ values ('ready', '0637a85a-c360-450b-900d-81f423cb21f3', 'Unlisted video without
row('http://localhost:38456/cat-black-x264-240p.mp4',
'presentation/preview', 'video/mp4', '{432, 240}', true)
]::event_track[],
'{}',
'{}'
);

insert into events (state, opencast_id, title, description, creators, metadata, series, part_of, duration, is_live,
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions)
created, updated, start_time, end_time, read_roles, write_roles, thumbnail, tracks, captions, segments)
values ('ready', '06a71e43-94cd-472d-a345-952979489e88', 'Unlisted video in series',
'Cheesecake is yummy',
'{"klimkin"}',
Expand All @@ -253,11 +263,13 @@ values ('ready', '06a71e43-94cd-472d-a345-952979489e88', 'Unlisted video in seri
row('http://localhost:38456/cat-black-x264-240p.mp4',
'presentation/preview', 'video/mp4', '{432, 240}', true)
]::event_track[],
'{}',
'{}'
);

-- TODO:
-- Video with subtitles -> array[row('https://...', 'en')]::event_caption[]
-- Video with slide segments?


-- ----- Realms ---------------------------------------------------------------
Expand Down
45 changes: 29 additions & 16 deletions util/fixtures.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ begin
insert into series (opencast_id, state, title, read_roles, write_roles, updated)
values ('event-tests', 'ready', 'Different event states', '{"ROLE_ANONYMOUS"}', '{"ROLE_ADMIN"}', now())
returning id into series_event_tests;
insert into events (opencast_id, state, updated, is_live, read_roles, write_roles, title, created, metadata, series, captions)
values ('waiting', 'waiting', '-infinity', false, '{"ROLE_ANONYMOUS"}', '{"ROLE_USER_SABINE"}', 'Waiting event', now(), '{}', series_event_tests, '{}');
insert into events (state, opencast_id, title, tracks, thumbnail, duration, series, created, updated, read_roles, write_roles, is_live, metadata, captions)
insert into events (opencast_id, state, updated, is_live, read_roles, write_roles, title, created, metadata, series, captions, segments)
values ('waiting', 'waiting', '-infinity', false, '{"ROLE_ANONYMOUS"}', '{"ROLE_USER_SABINE"}', 'Waiting event', now(), '{}', series_event_tests, '{}', '{}');
insert into events (state, opencast_id, title, tracks, thumbnail, duration, series, created, updated, read_roles, write_roles, is_live, metadata, captions, segments)
values (
'ready',
'restricted',
Expand All @@ -45,9 +45,10 @@ begin
'{}',
false,
'{}',
'{}',
'{}'
);
insert into events (state, opencast_id, title, tracks, thumbnail, duration, series, created, updated, read_roles, write_roles, metadata, is_live, start_time, captions)
insert into events (state, opencast_id, title, tracks, thumbnail, duration, series, created, updated, read_roles, write_roles, metadata, is_live, start_time, captions, segments)
values (
'ready',
'live-future',
Expand All @@ -69,9 +70,10 @@ begin
'{}',
true,
'9999-01-01',
'{}',
'{}'
);
insert into events (state, opencast_id, title, tracks, thumbnail, duration, series, created, updated, read_roles, write_roles, metadata, is_live, start_time, end_time, captions)
insert into events (state, opencast_id, title, tracks, thumbnail, duration, series, created, updated, read_roles, write_roles, metadata, is_live, start_time, end_time, captions, segments)
values (
'ready',
'live-present',
Expand All @@ -94,9 +96,10 @@ begin
true,
'epoch',
'9999-01-01',
'{}',
'{}'
);
insert into events (state, opencast_id, title, tracks, thumbnail, duration, series, created, updated, read_roles, write_roles, metadata, is_live, start_time, end_time, captions)
insert into events (state, opencast_id, title, tracks, thumbnail, duration, series, created, updated, read_roles, write_roles, metadata, is_live, start_time, end_time, captions, segments)
values (
'ready',
'live-past',
Expand All @@ -119,6 +122,7 @@ begin
true,
'epoch',
'2000-01-01',
'{}',
'{}'
);

Expand Down Expand Up @@ -149,7 +153,7 @@ begin


-- Add a bunch of events/videos
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions)
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions, segments)
values (
'ready',
'bbb',
Expand All @@ -173,9 +177,10 @@ begin
'{}',
false,
'{}',
'{}',
'{}'
);
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions)
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions, segments)
values (
'ready',
'cosmos-laundromat',
Expand All @@ -199,9 +204,10 @@ begin
'{}',
false,
'{}',
'{}',
'{}'
);
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions)
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions, segments)
values (
'ready',
'spring',
Expand All @@ -225,10 +231,11 @@ begin
'{}',
false,
'{}',
'{}',
'{}'
);

insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions)
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions, segments)
values (
'ready',
'bee',
Expand All @@ -252,10 +259,11 @@ begin
'{}',
false,
'{}',
'{}',
'{}'
);

insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions)
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions, segments)
values (
'ready',
'nasa',
Expand All @@ -279,10 +287,11 @@ begin
'{}',
false,
'{}',
array[row('https://oc.tobira.ethz.ch/static/mh_default_org/moontour_narrated.en_US.vtt', 'en')]::event_caption[]
array[row('https://oc.tobira.ethz.ch/static/mh_default_org/moontour_narrated.en_US.vtt', 'en')]::event_caption[],
'{}'
);

insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions)
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions, segments)
values (
'ready',
'pir-introduction',
Expand All @@ -306,9 +315,10 @@ begin
'{}',
false,
'{}',
'{}',
'{}'
);
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions)
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions, segments)
values (
'ready',
'pir-modules',
Expand All @@ -332,9 +342,10 @@ begin
'{}',
false,
'{}',
'{}',
'{}'
);
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions)
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions, segments)
values (
'ready',
'pir-stack-heap',
Expand All @@ -358,9 +369,10 @@ begin
'{}',
false,
'{}',
'{}',
'{}'
);
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions)
insert into events (state, opencast_id, title, tracks, thumbnail, duration, description, series, part_of, creators, created, updated, read_roles, write_roles, is_live, metadata, captions, segments)
values (
'ready',
'pir-performance',
Expand All @@ -384,6 +396,7 @@ begin
'{}',
false,
'{}',
'{}',
'{}'
);
end; $$;
Expand Down

0 comments on commit d10fdbb

Please sign in to comment.