Joystream / Joystream/joystream

Giza integration tests: Joystream CLI: Channels and videos flow

Open
#2,838 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CLI estimate-24h network-integration-test qn-hydra-board query-node to-triage
Dominant language
Rust
Stars
1.4k
Forks
116
PR merge metrics
No merged PRs in 30d

Description

Preconditions:

  • A running Joystream node
  • A running query-node
  • A running storage node (which accepts channel assets and has sufficient limits set to handle the scenario)
  • A running distributor node (which accepts channel assets and has sufficient limits set to handle the scenario)
  • Curator lead is hired
  • Storage lead is hired
  • Optionally: There is a curator group with at least 1 curator (it can also be created in this flow)
  • Optionally: Some video/channel categories are available (they can also be created in this flow)

Constants:

  • Icc - number of different input cases to test for createChannel
  • Iuc - number of different input cases to test for updateChannel
  • Icv - number of different input cases to test for createVideo
  • Iuv - number of different input cases to test for updateVideo

Parameters:

  • Cc - number of Member/Curator group channels to create
  • Dc - number of Member/Curator group channels to delete
  • Uc - number Member/Curator group channels to update
  • Uv - number of Member/Curator group videos to update
  • Cv - number of videos to create per channel
  • Hc - number of Member/Curator group channels to censor
  • Sc - number of Member/Curator group channels to uncensor
  • Hv - number of Member/Curator group videos to censor
  • Sv - number of Member/Curator group videos to uncensor

Constraints:

  • 1 <= Icc <= Cc
  • Icv <= Cv * Cc * 2
  • Iuc <= Uc
  • Iuv <= Uv
  • 1 <= Sc <= Hc
  • `1 <= Sv <= Hv

Optimistic flow:

  • Create and initialize members (channel owners)
  • Create and initialize members (contributors)
  • Create and initialize curator groups (if none available)
  • Create channels
    • Create Cc Member channels (cover all createChannel input cases)
    • Create Cc Curator Group channels (cover all createChannel input cases)
    • Verify the output of content:channels: confirm channels created with expected owners, reward accs etc.
    • Verify the output of content:channel for each channel: confirm channel data is valid in each case
    • Verify channels metadata and assets data using query-node
    • Verify channel assets can be retrieved from distributor node
  • Update channels (owner)
    • Update Uc Member channels (cover all updateChannel input cases listed below, use Collaborator context for update 3.)
    • Update Uc Curator channels (cover all updateChannel input cases listed below, use Collaborator context for update 3.)
    • Verify the output of content:channels: confirm channels reward accs updated where expected
    • Verify the output of content:channel for each channel: confirm channel data updated as expected
    • Verify channels metadata and assets data using query-node: confirm updated as expected
    • Verify new channel assets are accessible from distributor node
  • Change channels censorship status
    • Censor Hc Member channels (as curator)
    • Censor Hc Curator channels (as lead)
    • Verify the output of content:channels: confirm channels censorship status
    • Verify the output of content:channel for each channel: confirm channel censorship status
    • Verify channels censorship status using query-node
    • Uncensor Sc Member channels (as curator)
    • Uncensor Sc Curaotr channels (as lead)
    • Verify the output of content:channels: confirm channels censorship status
    • Verify the output of content:channel for each channel: confirm channel censorship status
    • Verify channels censorship status using query-node
  • Create videos
    • Add Cv videos to each channel (cover all createVideo input cases listed below)
    • Verify the output of content:channels: confirm video counts match
    • Verify the output of content:channel for each channel: confirm video counts match
    • Verify the output of videos - confirm all videos are listed and the data matches the expectations
    • Verify the output of videos [CHANNEL_ID] for each channel - confirm only the expected videos are listed
    • Verify the output of video for each video - confirm video data matches the expectations
    • Verify videos metadata and assets data using query-node
    • Verify video assets are accessible from distributor node
  • Change videos censorship status
    • Censor Hv Member channel videos (use curator context)
    • Censor Sv Curator group videos (use lead context)
    • Verify the output of videos - confirm censorship status
    • Verify the output of video for each video - confirm censorship status
    • Verify videos censorship status using query-node
    • Uncensor Sv Member channel videos (use curator context)
      -Uncensor Sv Curator group videos (use lead context)
    • Verify the output of videos - confirm censorship status
    • Verify the output of video for each video - confirm censorship status
    • Verify videos censorship status using query-node
  • Update videos
    • Update Uv Member channel videos (cover all updateVideo metadata cases listed below)
    • Update Uv Curator group channel videos (cover all updateVideo metadata cases listed below)
    • Verify updated videos metadata and assets data using query-node
    • Verify new video assets are accessible from distributor node
  • Remove assets
    • Delete assets of a video using removeChannelAssets (test for both Member and Curator channel)
    • Delete assets of a channel using removeChannelAssets (test for both Member and Curator channel)
    • Verify updated channel and video metadata and assets data using query-node
  • Deleting videos
    • Delete a video with no assets using deleteVideo w/o --force flag (test for both Member and Curator channel)
    • Delete all remaining videos in Dc Member channels w/ --force flag
    • Delete all remaning videos in Dc Curator group channels w/ --force flag
    • Verify the output of videos - confirm videos are removed
    • Verify the output of video for each video - confirm 400 exit code
    • Verify videos are no longer retrieveable from query node
  • Deleting channels
    • Delete a channel with no assets w/o --force flag (test for both Member and Curator channel)
    • Delete remaining Dc-1 Member channels w/ --force flag
    • Delete remaining Dc-1 Curator group channels w/ --force flag
    • Verify the output of channels - confirm channels are removed
    • Verify the output of channel for each channel - confirm 400 exit code
    • Verify channels are no longer retrieveable from query node

createChannel input cases to test:

  1. Full valid metadata case
  {
    "title": "Test channel case 1",
    "description": "Channel with full valid metadata set at creation",
    "isPublic": true,
    "language": "en",
    "category": 1,
    "avatarPhotoPath": "/path/to/avatar-photo.bmp",
    "coverPhotoPath": "/path/to/cover-photo.bmp",
    "rewardAccount": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
    "collaborators": [a, b, c] // Populated with legit member/members
  }
  1. No avatar photo, invalid category and no reward account case
  {
    "title": "Test channel case 2",
    "description": "Channel with no avatar photo, invalid category and no reward acc set at creation",
    "isPublic": true,
    "language": "de",
    "category": 999,
    "coverPhotoPath": "/path/to/cover-photo.bmp",
    "collaborators": [a, b, c] // Populated with legit member/members
  }
  1. No cover photo, unpublic and invalid language case
  {
    "title": "Test channel case 3",
    "description": "Channel with no cover photo, invalid language and isPublic=false set at creation",
    "isPublic": false,
    "language": "xx",
    "category": 3,
    "avatarPhotoPath": "/path/to/avatar-photo.bmp",
    "rewardAccount": "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y",
    "collaborators": [a, b, c] // Populated with legit member/members
  }
  1. Empty channel case
  { }

updateChannel input cases to test:

  1. Clear all (invalid category/language) + replace both assets case
  {
    "title": "",
    "description": "",
    "isPublic": false,
    "language": "",
    "category": 999,
    "avatarPhotoPath": "/path/to/avatar-photo-2.bmp",
    "coverPhotoPath": "/path/to/cover-photo-2.bmp",
    "rewardAccount": null,
    "collaborators": []
  }
  1. Setting reward account, valid category and updating cover photo case
  {
    "rewardAccount": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",
    "category": 2,
    "coverPhotoPath": "/path/to/cover-photo-2.bmp",
  }
  1. Setting public status, valid language and updating avatar photo case
  {
    "isPublic": true,
    "language": "sk",
    "avatarPhotoPath": "/path/to/avatar-photo-2.bmp",
  }
  1. Setting full metadata case
  {
    "title": "Update channel case 4",
    "description": "Updating full channel metadata",
    "isPublic": true,
    "language": "es",
    "category": 4,
    "avatarPhotoPath": "/path/to/avatar-photo.bmp",
    "coverPhotoPath": "/path/to/cover-photo.bmp",
    "rewardAccount": "5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy",
    "collaborators": [a, b, c] // Populated with legit member/members
  }

createVideo input cases to test:

  1. Full valid metadata case
{
  "title": "Test video case 1",
  "description": "Video with full valid metadata set at creation",
  "videoPath": "/path/to/video.mp4",
  "thumbnailPhotoPath": "/path/to/thumbnail.png",
  "language": "en",
  "hasMarketing": true,
  "isPublic": true,
  "isExplicit": true,
  "personsList": [1, 2, 3],
  "category": 1,
  "license": {
    "code": 1003,
    "attribution": "by Joystream Contributors",
    "customText": "Additional custom text"- 
  },
  "publishedBeforeJoystream": {
    "isPublished": true,
    "date": "2020-01-01"
  },
  "mediaPixelWidth": 100,
  "mediaPixelHeight": 200,
  "duration": 10,
  "mediaType": {
    "codecName": "Custom codec name",
    "container": "Custom container",
    "mimeMediaType": "Custom mime media type"
  }
}
  1. No video file, invalid category, invalid license, publishedBeforeJoystream.isPublished=false,
{
  "title": "Test video case 2",
  "description": "Video with no video file, invalid category, invalid license, publishedBeforeJoystream.isPublished=false set at creation",
  "thumbnailPhotoPath": "/path/to/thumbnail.png",
  "language": "gb",
  "hasMarketing": false,
  "isPublic": true,
  "isExplicit": false,
  "personsList": [],
  "category": 999,
  "license": {
    "code": 9999,
    "attribution": "Invalid license"
  },
  "publishedBeforeJoystream": {
    "isPublished": false,
    "date": "2020-01-01"
  }
}
  1. No thumbnail, invalid publishedBeforeJoystream date, invalid language, missing required license attribution, partial mediaType
{
  "title": "Test video case 3",
  "description": "Video with no thumbnail, invalid publishedBeforeJoystream date, invalid language, missing required license attribution, partial mediaType set at creation",
  "videoPath": "/path/to/video.mp4",
  "language": "xx",
  "hasMarketing": false,
  "isPublic": false,
  "isExplicit": false,
  "personsList": [],
  "category": 3,
  "license": {
    "code": 1008
  },
  "publishedBeforeJoystream": {
    "isPublished": true,
    "date": "abc"
  },
  "mediaType": {
    "codecName": "Custom codec name",
  }
}
  1. Empty video case
{ }

updateVideo input cases to test:

  1. Clear all (invalid category/language) + replace both assets case
{
  "title": "",
  "description": "",
  "videoPath": "/path/to/video-2.mp4",
  "thumbnailPhotoPath": "/path/to/thumbnail-2.png",
  "language": "",
  "hasMarketing": false,
  "isPublic": false,
  "isExplicit": false,
  "personsList": [0], // FIXME: No way to explicitly unset now
  "category": 999,
  "license": {},
  "publishedBeforeJoystream": {},
  "mediaPixelWidth": 0, // FIXME: No way to explicitly unset now
  "mediaPixelHeight": 0, // FIXME: No way to explicitly unset now
  "duration": 0, // FIXME: No way to explicitly unset now
  "mediaType": {}
}
  1. Update thumbnail, unpublish, set valid category, set valid license, set valid publishedBeforeJoystream
{
  "thumbnailPhotoPath": "/path/to/thumbnail-2.png",
  "isPublic": false,
  "category": 2,
  "license": {
    "code": 1000,
    "customText": "Some valid custom license"
  },
  "publishedBeforeJoystream": {
    "isPublished": true,
    "date": "1965-01-01"
  }
}
  1. Update video file, partial mediaType update, set valid language, publish
{
  "videoPath": "/path/to/video-2.mp4",
  "language": "pl",
  "isPublic": true,
  "mediaType": {
    "codecName": "Custom codec name",
  }
}
  1. Set all case
{
  "title": "Update video case 4",
  "description": "Updating full video metadata",
  "videoPath": "/path/to/video.mp4",
  "thumbnailPhotoPath": "/path/to/thumbnail.png",
  "language": "sk",
  "hasMarketing": true,
  "isPublic": true,
  "isExplicit": true,
  "personsList": [1, 2, 3],
  "category": 4,
  "license": {
    "code": 1006,
    "attribution": "Joystream Contributors",
    "customText": "Some custom text"
  },
  "publishedBeforeJoystream": {
    "isPublished": true,
    "date": "2021-12-24"
  },
  "mediaPixelWidth": 1024,
  "mediaPixelHeight": 768,
  "duration": 120,
  "mediaType": {
    "codecName": "h263",
    "container": "MP4",
    "mimeMediaType": "video/mp4"
  }
}

Possible additional failure cases to include:

  • Invalid metadata when creating/updating a channel/video: expect exit code 400 - InvalidInput
  • Invalid asset file paths in metadata when creating/updating channel/video
  • Updating channel/adding videos/removing channel assets/removing channel with using non-owner context that matches selected account (multiple possible combinations): expect exit code 405 - AccessDenied
  • Executing any of the commands with context not matching selected account: expect exit code 405 - AccessDenied
  • Updating/removing a non-existing channel/video: expect exit code 400 - InvalidInput
  • Updating non-existring channel/video censorship status: expect exit code 400 - InvalidInput
  • Removing channel assets that don't belong to the given channel: expect exit code 400 - InvalidInput
  • Removing channel/video with existing assets without --force flag: expect exit code 400 - InvalidInput
  • Censoring Curator Group video/channel using Curator context: expect 405 - AccessDenied
  • Trying to update channel's reward account / collaborators using Collaborator context: expect 405 - AccessDenied

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Joystream CLI integration-test entry point and the commands named in this issue, including content:channels, content:channel, videos, video, and the asset-removal flow. Define the required node, query-node, storage-node, and distributor-node setup, then implement the listed channel and video scenarios and verify CLI, query-node, and asset results match the expected lifecycle.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript
Domain
cli, distributed-systems, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.