Skip to content

Commit

Permalink
added local copy for videoUpload E2E test in CI pipe so its in the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Radoslav Radev committed May 1, 2024
1 parent 09619ea commit 9f835c8
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/E2Etest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
- name: Install Chrome
run: choco install googlechrome --ignore-checksums

- name: Sleep for 10m
run: Start-Sleep -s 600
shell: powershell

- name: Navigate to E2E Tests directory
run: cd Backend/Tests/E2E.Tests

Expand Down
4 changes: 2 additions & 2 deletions Backend/Tests/E2E.Tests/UploadVideo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public void Upload()
_driver.FindElement(UploadPage.TitleInput).SendKeys($"Test-{new Guid().ToString()}");
_driver.FindElement(UploadPage.DescriptionInput).SendKeys("Test Description, Lorem Ipsum Dolor Sit Amet Consectetur Adipiscing Elit Sed Do Eiusmod Tempor Incididunt Ut Labore Et Dolore Magna Aliqua Ut Enim Ad Minim Veniam Quis Nostrud Exercitation Ullamco Laboris Nisi Ut Aliquip Ex Ea Commodo Consequat");
_driver.FindElement(UploadPage.CategoryInput).SendKeys("Music");
_driver.FindElement(UploadPage.SelectVideoButton).SendKeys(@"C:\Users\ra408\Videos\2023-12-28 12-47-54.mkv");
_driver.FindElement(UploadPage.SelectThumbnail).SendKeys(@"D:\Downloads\business-woman-pictures-pwo11q6cg9pxqq7c.jpg");
_driver.FindElement(UploadPage.SelectVideoButton).SendKeys(@"tmp\SampleVideo1mb.mp4");
_driver.FindElement(UploadPage.SelectThumbnail).SendKeys(@"tmp\sampleThumbnail.jpg");
_driver.FindElement(UploadPage.UploadButton).Click();
Thread.Sleep(7000);
var alert = _driver.SwitchTo().Alert();
Expand Down
39 changes: 39 additions & 0 deletions K6Tests/LikeVideo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import http from 'k6/http';
import { sleep } from 'k6';

export let options = {
stages: [
{ duration: '1m', target: 2000 }, // Ramp up to 100 users over 1 minute
{ duration: '2m', target: 20 }, // Stay at 20 users for 2 minutes
{ duration: '1m', target: 0 }, // Ramp down to 0 users over 1 minute
],
thresholds: {
'http_req_duration': ['p(95)<500'] // 95% of requests must complete below 500ms
},
ext: {
loadimpact: {
// Project: OpenVidStreamer
projectID: 3693023,
// Test runs with the same name groups test runs together.
name: 'LikeVideo',
}
}
};

export default function () {
const params = {
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cG4iOiIwOGRjNDIwNy1mZWMwLTRlOTctOGY4MC0zYWU1MDUyYTMwNWEiLCJzdWIiOiIwOGRjNDIwNy1mZWMwLTRlOTctOGY4MC0zYWU1MDUyYTMwNWEiLCJqdGkiOiIxYTM5ZDI0Ny02NjkwLTRkYzItODFhNi1hMTljZmI0MWI4MjIiLCJleHAiOjE3MTM3ODgyMzgsImlzcyI6Ik9wZW5WaWRTdHJlYW1lckFjY291bnRTZXJ2aWNlIiwiYXVkIjoiT3BlblZpZFN0cmVhbWVyRkUifQ.Z8u7QhROGm9jjr0Ih9s4weNHlialLU08dGnCRDo36ug'
}

};

let response = http.get('http://145.220.74.148:8000/recommendationAlgo/likeVideo?videoId=1bf7a7ce-a9bf-47b2-b9f9-23877f82ec66', params);

// Optionally, you can check the response and log errors
if (response.status !== 200) {
console.log('Unexpected status ' + response.status);
}

sleep(1); // Pause for 1 second between iterations
}
39 changes: 39 additions & 0 deletions K6Tests/StreamVideo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import http from 'k6/http';
import { sleep } from 'k6';

export let options = {
stages: [
{ duration: '2m', target: 10000 }, // Ramp up to 10 000 users over 2 minute
{ duration: '7m', target: 10000 }, // Stay at 10000 CPS for 7min
{ duration: '1m', target: 0 }, // Ramp down to 0 users over 1 minute
],
thresholds: {
'http_req_duration': ['p(90)<10000'] // 89% of requests must complete below 10sec each HSL video chunc is 10sec long, and if it`s not loaded in 10sec it will result in loading for the user
},
ext: {
loadimpact: {
// Project: OpenVidStreamer
projectID: 3693023,
// Test runs with the same name groups test runs together.
name: 'StreamVideo',
}
}
};

export default function () {
const params = {
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cG4iOiIwOGRjNDIwNy1mZWMwLTRlOTctOGY4MC0zYWU1MDUyYTMwNWEiLCJzdWIiOiIwOGRjNDIwNy1mZWMwLTRlOTctOGY4MC0zYWU1MDUyYTMwNWEiLCJqdGkiOiIyNWYwNjgxZC04NzMwLTQ4ZDgtODIyMC0xMzYyMzAwNGVhMmIiLCJleHAiOjE3MTQ1NzE3MTAsImlzcyI6Ik9wZW5WaWRTdHJlYW1lckFjY291bnRTZXJ2aWNlIiwiYXVkIjoiT3BlblZpZFN0cmVhbWVyRkUifQ.LV4iObB6OXV66kdx9caprcWawHbgAHG0HmyYEvuuxmk'
}

};

let response = http.get('http://145.220.74.148:8000/streamer/videos/20240409/43a3308d-e879-4954-857c-f45171e1f27f/playlist3.ts', params);

// Optionally, you can check the response and log errors
if (response.status !== 200) {
console.log('Unexpected status ' + response.status);
}

// sleep(1); // Pause for 1 second between iterations
}
31 changes: 31 additions & 0 deletions K6Tests/getRecommendedVideos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import http from 'k6/http';
import { sleep } from 'k6';

export let options = {
stages: [
{ duration: '1m', target: 100 }, // Ramp up to 100 users over 1 minute
{ duration: '1m', target: 100 }, // Stay at 100 users (rps) for 10 minutes
{ duration: '1m', target: 0 }, // Ramp down to 0 users over 1 minute
],
thresholds: {
'http_req_duration': ['p(90)<700'] // 90% of requests must complete below 700ms
}
};

export default function () {
const params = {
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cG4iOiIwOGRjNDIwNy1mZWMwLTRlOTctOGY4MC0zYWU1MDUyYTMwNWEiLCJzdWIiOiIwOGRjNDIwNy1mZWMwLTRlOTctOGY4MC0zYWU1MDUyYTMwNWEiLCJqdGkiOiIyNWYwNjgxZC04NzMwLTQ4ZDgtODIyMC0xMzYyMzAwNGVhMmIiLCJleHAiOjE3MTQ1NzE3MTAsImlzcyI6Ik9wZW5WaWRTdHJlYW1lckFjY291bnRTZXJ2aWNlIiwiYXVkIjoiT3BlblZpZFN0cmVhbWVyRkUifQ.LV4iObB6OXV66kdx9caprcWawHbgAHG0HmyYEvuuxmk'
}

};

let response = http.get('http://145.220.74.148:8000/videolib/recommendedVideos?category=Other&topN=20', params);

// Optionally, you can check the response and log errors
if (response.status !== 200) {
console.log('Unexpected status ' + response.status);
}

// sleep(1); // Pause for 1 second between iterations
}
Binary file added K6Tests/getRecommendedVideos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added K6Tests/likeVideos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tmp/SampleVideo1mb.mp4
Binary file not shown.
Binary file added tmp/sampleThumbnail.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9f835c8

Please sign in to comment.