Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Run Playwright tests with submission builds sequentially #9623

Merged
merged 21 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ca84764
Run tests that trigger builds sequentially (as slow tests) to avoid o…
muradium Oct 27, 2024
5e80f77
Merge branch 'develop' into feature/playwright/parallelism-fast-slow-…
muradium Oct 28, 2024
9bb8220
Custom timeouts for fast and slow tests, include tests without tags a…
muradium Oct 30, 2024
f3667ca
Use locally installed playwright package
muradium Oct 31, 2024
8d3dbbf
Change test directory path of projects to non-relative
muradium Oct 31, 2024
d31c712
Fix fast test regex
muradium Oct 31, 2024
6031b78
Change regex to RegExp
muradium Oct 31, 2024
9821e83
Add project that includes all tests to make setup test included in th…
muradium Nov 3, 2024
a4b5c46
Write both test project results to a single results file instead of m…
muradium Nov 3, 2024
3c1acfa
Revert "Write both test project results to a single results file inst…
muradium Nov 3, 2024
c0690b7
Fix reporter output path, remove redundant test project
muradium Nov 3, 2024
28ebce9
Remove custom test dir, set directory in test run commands
muradium Nov 3, 2024
7143804
Tag exam statistics as a slow test
muradium Nov 4, 2024
4dd399d
Merge branch 'develop' into feature/playwright/parallelism-fast-slow-…
muradium Nov 4, 2024
544207c
Simplify project regex
muradium Nov 5, 2024
75b0138
Avoid using rm command in scripts to make it work cross-platform
muradium Nov 5, 2024
d9c85be
Transfer test run and merge report logic to compose file
muradium Nov 5, 2024
586980f
Improve scripts
muradium Nov 5, 2024
2d17ff1
Use npm-run-all and cross-env for cross-platform support for running …
muradium Nov 6, 2024
60e9d3e
Fix default test timeouts on env file
muradium Nov 6, 2024
f2599a4
Merge branch 'develop' into feature/playwright/parallelism-fast-slow-…
muradium Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions docker/playwright-E2E-tests-multi-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,6 @@ services:
condition: service_healthy
environment:
PLAYWRIGHT_DB_TYPE: 'MySQL'
command: >
sh -c '
cd /app/artemis/src/test/playwright &&
chmod 777 /root &&
npm ci &&
npm run playwright:setup &&
npm run playwright:test
'

networks:
artemis:
Expand Down
8 changes: 0 additions & 8 deletions docker/playwright-E2E-tests-mysql-localci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ services:
condition: service_healthy
environment:
PLAYWRIGHT_DB_TYPE: 'MySQL'
command: >
sh -c '
cd /app/artemis/src/test/playwright &&
chmod 777 /root &&
npm ci &&
npm run playwright:setup &&
npm run playwright:test
'

networks:
artemis:
Expand Down
8 changes: 0 additions & 8 deletions docker/playwright-E2E-tests-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ services:
condition: service_healthy
environment:
PLAYWRIGHT_DB_TYPE: 'MySQL'
command: >
sh -c '
chmod 777 /root &&
cd /app/artemis/src/test/playwright &&
npm ci &&
npm run playwright:setup &&
npm run playwright:test
'

networks:
artemis:
Expand Down
8 changes: 0 additions & 8 deletions docker/playwright-E2E-tests-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ services:
condition: service_healthy
environment:
PLAYWRIGHT_DB_TYPE: 'Postgres'
command: >
sh -c '
chmod 777 /root &&
cd /app/artemis/src/test/playwright &&
npm ci &&
npm run playwright:setup &&
npm run playwright:test
'

networks:
artemis:
Expand Down
12 changes: 11 additions & 1 deletion docker/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@ services:
TEST_TIMEOUT_SECONDS: '${bamboo_test_timeout_seconds}'
TEST_RETRIES: '${bamboo_test_retries}'
TEST_WORKER_PROCESSES: '${bamboo_test_worker_processes}'
command: sh -c "cd /app/artemis/src/test/playwright && chmod 777 /root && npm ci && npm run playwright:test"
SLOW_TEST_TIMEOUT_SECONDS: '${bamboo_slow_test_timeout_seconds}'
FAST_TEST_TIMEOUT_SECONDS: '${bamboo_fast_test_timeout_seconds}'
command: >
sh -c '
cd /app/artemis/src/test/playwright &&
chmod 777 /root &&
npm ci &&
npm run playwright:setup &&
npm run playwright:test;
rm ./test-reports/results-fast.xml ./test-reports/results-slow.xml
'
volumes:
- ..:/app/artemis
networks:
Expand Down
2 changes: 1 addition & 1 deletion src/test/playwright/e2e/Login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { test } from '../support/fixtures';
import { studentOne } from '../support/users';
import { BASE_API } from '../support/constants';

test.describe('Login page tests', () => {
test.describe('Login page tests', { tag: '@fast' }, () => {
test('Logs in via the UI', async ({ page, loginPage }) => {
await page.goto('/');
await loginPage.login(studentOne);
Expand Down
2 changes: 1 addition & 1 deletion src/test/playwright/e2e/SystemHealth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const healthChecks = [
{ selector: '#websocketConnection', name: 'websocket connection', expectedStatus: 'Connected' },
];

test.describe('Check artemis system health', () => {
test.describe('Check artemis system health', { tag: '@fast' }, () => {
let page: Page;

test.beforeAll('Login as admin and visit system health page', async ({ browser }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/playwright/e2e/course/CourseExercise.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { QuizExercise } from 'app/entities/quiz/quiz-exercise.model';
import multipleChoiceQuizTemplate from '../../fixtures/exercise/quiz/multiple_choice/template.json';
import { expect } from '@playwright/test';

test.describe('Course exercise', () => {
test.describe('Course exercise', { tag: '@fast' }, () => {
let course: Course;

test.beforeEach('Create course', async ({ login, courseManagementAPIRequests }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/playwright/e2e/course/CourseManagement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const editedCourseData = {
const allowGroupCustomization = process.env.ALLOW_GROUP_CUSTOMIZATION;
const dateFormat = 'MMM D, YYYY HH:mm';

test.describe('Course management', () => {
test.describe('Course management', { tag: '@fast' }, () => {
test.describe('Manual student selection', () => {
let course: Course;

Expand Down
2 changes: 1 addition & 1 deletion src/test/playwright/e2e/course/CourseMessages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { generateUUID, titleLowercase } from '../../support/utils';
import { Channel } from 'app/entities/metis/conversation/channel.model';
import { GroupChat } from 'app/entities/metis/conversation/group-chat.model';

test.describe('Course messages', () => {
test.describe('Course messages', { tag: '@fast' }, () => {
let course: Course;

test.beforeEach('Create course', async ({ login, courseManagementAPIRequests, courseMessages }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/test/playwright/e2e/exam/ExamAssessment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test.beforeAll('Create course', async ({ browser }) => {
studentOneName = (await users.getUserInfo(studentOne.username, page)).name!;
});

test.describe('Exam assessment', () => {
test.describe('Exam assessment', { tag: '@slow' }, () => {
let programmingAssessmentSuccessful = false;
let modelingAssessmentSuccessful = false;
let textAssessmentSuccessful = false;
Expand Down Expand Up @@ -222,7 +222,7 @@ test.describe('Exam grading', () => {
});
});

test.describe('Exam statistics', () => {
test.describe('Exam statistics', { tag: '@slow' }, () => {
let exercise: Exercise;
const students = [studentOne, studentTwo, studentThree, studentFour];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const editedExamData = {

const dateFormat = 'MMM D, YYYY HH:mm';

test.describe('Exam creation/deletion', () => {
test.describe('Exam creation/deletion', { tag: '@fast' }, () => {
let course: Course;
let examId: number;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { admin, studentOne } from '../../support/users';
import { generateUUID } from '../../support/utils';
import { Fixtures } from '../../fixtures/fixtures';

test.describe('Exam date verification', () => {
test.describe('Exam date verification', { tag: '@fast' }, () => {
let course: Course;
let examTitle: string;

Expand Down
2 changes: 1 addition & 1 deletion src/test/playwright/e2e/exam/ExamManagement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CourseManagementAPIRequests } from '../../support/requests/CourseManage
import { ExamAPIRequests } from '../../support/requests/ExamAPIRequests';
import { ExerciseAPIRequests } from '../../support/requests/ExerciseAPIRequests';

test.describe('Exam management', () => {
test.describe('Exam management', { tag: '@fast' }, () => {
test.describe('Exercise group', () => {
let course: Course;
let exam: Exam;
Expand Down
2 changes: 1 addition & 1 deletion src/test/playwright/e2e/exam/ExamParticipation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { ExamParticipationActions } from '../../support/pageobjects/exam/ExamPar
const textFixture = 'loremIpsum.txt';
const textFixtureShort = 'loremIpsum-short.txt';

test.describe('Exam participation', () => {
test.describe('Exam participation', { tag: '@slow' }, () => {
let course: Course;
let exerciseArray: Array<Exercise> = [];
let studentTwoName: string;
Expand Down
2 changes: 1 addition & 1 deletion src/test/playwright/e2e/exam/ExamResults.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ProgrammingExerciseTaskStatus } from '../../support/pageobjects/exam/Ex
import { Page } from '@playwright/test';
import { StudentExam } from 'app/entities/student-exam.model';

test.describe('Exam Results', () => {
test.describe('Exam Results', { tag: '@slow' }, () => {
let course: Course;

test.beforeEach('Create course', async ({ browser }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/playwright/e2e/exam/ExamTestRun.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { expect } from '@playwright/test';
const textFixture = 'loremIpsum-short.txt';
const examTitle = 'exam' + generateUUID();

test.describe('Exam test run', () => {
test.describe('Exam test run', { tag: '@slow' }, () => {
let course: Course;
let exam: Exam;
let exerciseArray: Array<Exercise> = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const examData = {
confirmationEndText: 'Exam confirmation end text',
};

test.describe('Test Exam creation/deletion', () => {
test.describe('Test Exam creation/deletion', { tag: '@slow' }, () => {
let course: Course;
let exam: Exam;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { expect } from '@playwright/test';
const uid = generateUUID();
const examTitle = 'test-exam' + uid;

test.describe('Test Exam management', () => {
test.describe('Test Exam management', { tag: '@slow' }, () => {
let course: Course;
let exam: Exam;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect } from '@playwright/test';
// Common primitives
const textFixture = 'loremIpsum-short.txt';

test.describe('Test exam participation', () => {
test.describe('Test exam participation', { tag: '@slow' }, () => {
let course: Course;
let exerciseArray: Array<Exercise> = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const studentNames = new Map<UserCredentials, string>();

let examExercise: Exercise;

test.describe('Test Exam - student exams', () => {
test.describe('Test Exam - student exams', { tag: '@slow' }, () => {
let course: Course;
let exam: Exam;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { expect } from '@playwright/test';
const textFixture = 'loremIpsum.txt';
const examTitle = 'exam' + generateUUID();

test.describe('Test exam test run', () => {
test.describe('Test exam test run', { tag: '@slow' }, () => {
let course: Course;
let exam: Exam;
let exerciseArray: Array<Exercise> = [];
Expand Down
2 changes: 1 addition & 1 deletion src/test/playwright/e2e/exercise/ExerciseImport.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { TextSubmission } from 'app/entities/text/text-submission.model';
import { QuizSubmission } from 'app/entities/quiz/quiz-submission.model';
import { ModelingSubmission } from 'app/entities/modeling-submission.model';

test.describe('Import exercises', () => {
test.describe('Import exercises', { tag: '@slow' }, () => {
let course: Course;
let secondCourse: Course;
let textExercise: TextExercise;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const tutorFeedback = 'Try to use some newlines next time!';
const tutorFeedbackPoints = 4;
const complaint = "That feedback wasn't very useful!";

test.describe('File upload exercise assessment', () => {
test.describe('File upload exercise assessment', { tag: '@fast' }, () => {
muradium marked this conversation as resolved.
Show resolved Hide resolved
let course: Course;
let exercise: FileUploadExercise;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { generateUUID } from '../../../support/utils';
import { test } from '../../../support/fixtures';
import { expect } from '@playwright/test';

test.describe('File upload exercise management', () => {
test.describe('File upload exercise management', { tag: '@fast' }, () => {
let course: Course;

test.beforeEach('Create course', async ({ login, courseManagementAPIRequests }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { test } from '../../../support/fixtures';
import { expect } from '@playwright/test';
import { FileUploadSubmission } from 'app/entities/file-upload-submission.model';

test.describe('File upload exercise participation', () => {
test.describe('File upload exercise participation', { tag: '@fast' }, () => {
muradium marked this conversation as resolved.
Show resolved Hide resolved
let course: Course;
let exercise: FileUploadExercise;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ExerciseAPIRequests } from '../../../support/requests/ExerciseAPIReques
import { Commands } from '../../../support/commands';
import { newBrowserPage } from '../../../support/utils';

test.describe('Modeling Exercise Assessment', () => {
test.describe('Modeling Exercise Assessment', { tag: '@fast' }, () => {
muradium marked this conversation as resolved.
Show resolved Hide resolved
let course: Course;
let modelingExercise: ModelingExercise;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { generateUUID } from '../../../support/utils';
import { test } from '../../../support/fixtures';
import { expect } from '@playwright/test';

test.describe('Modeling Exercise Management', () => {
test.describe('Modeling Exercise Management', { tag: '@fast' }, () => {
let course: Course;

test.beforeEach('Create course', async ({ login, courseManagementAPIRequests }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ModelingExercise } from 'app/entities/modeling-exercise.model';
import { admin, studentOne } from '../../../support/users';
import { test } from '../../../support/fixtures';

test.describe('Modeling Exercise Participation', () => {
test.describe('Modeling Exercise Participation', { tag: '@slow' }, () => {
muradium marked this conversation as resolved.
Show resolved Hide resolved
let course: Course;
let modelingExercise: ModelingExercise;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const tutorCodeFeedback = 'The input parameter should be mentioned in javadoc!';
const tutorCodeFeedbackPoints = -2;
const complaint = "That feedback wasn't very useful!";

test.describe('Programming exercise assessment', () => {
test.describe('Programming exercise assessment', { tag: '@slow' }, () => {
let course: Course;
let exercise: ProgrammingExercise;
let dueDate: dayjs.Dayjs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { generateUUID } from '../../../support/utils';
import { expect } from '@playwright/test';
import { Exercise, ExerciseMode } from '../../../support/constants';

test.describe('Programming Exercise Management', () => {
test.describe('Programming Exercise Management', { tag: '@slow' }, () => {
let course: Course;

test.beforeEach('Create course', async ({ login, courseManagementAPIRequests }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Team } from 'app/entities/team.model';
import { ProgrammingExerciseOverviewPage } from '../../../support/pageobjects/exercises/programming/ProgrammingExerciseOverviewPage';
import { Participation } from 'app/entities/participation/participation.model';

test.describe('Programming exercise participation', () => {
test.describe('Programming exercise participation', { tag: '@slow' }, () => {
let course: Course;

test.beforeEach('Create course', async ({ login, courseManagementAPIRequests }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { admin, studentOne } from '../../../support/users';
import { test } from '../../../support/fixtures';
import { expect } from '@playwright/test';

test.describe('Static code analysis tests', () => {
test.describe('Static code analysis tests', { tag: '@slow' }, () => {
let course: Course;
let exercise: ProgrammingExercise;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import shortAnswerQuizTemplate from '../../../fixtures/exercise/quiz/short_answe
import { admin, studentOne, tutor } from '../../../support/users';
import { test } from '../../../support/fixtures';

test.describe('Quiz Exercise Assessment', () => {
test.describe('Quiz Exercise Assessment', { tag: '@slow' }, () => {
let course: Course;

test.beforeEach('Create course', async ({ login, courseManagementAPIRequests }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { expect } from '@playwright/test';

let course: Course;

test.describe('Quiz Exercise Drop Location Spec', () => {
test.describe('Quiz Exercise Drop Location Spec', { tag: '@fast' }, () => {
test.beforeEach('Create course', async ({ login, courseManagementAPIRequests }) => {
await login(admin);
course = await courseManagementAPIRequests.createCourse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { test } from '../../../support/fixtures';
import { expect } from '@playwright/test';
import { promises as fs } from 'fs';

test.describe('Quiz Exercise Management', () => {
test.describe('Quiz Exercise Management', { tag: '@fast' }, () => {
let course: Course;

test.beforeEach('Create course', async ({ login, courseManagementAPIRequests }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { expect } from '@playwright/test';
import dayjs from 'dayjs';
import { QuizMode } from '../../../support/constants';

test.describe('Quiz Exercise Participation', () => {
test.describe('Quiz Exercise Participation', { tag: '@fast' }, () => {
let course: Course;

test.beforeEach('Create course', async ({ login, courseManagementAPIRequests }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const tutorTextFeedback = 'Nice ending of the sentence!';
const tutorTextFeedbackPoints = 2;
const complaint = "That feedback wasn't very useful!";

test.describe('Text exercise assessment', () => {
test.describe('Text exercise assessment', { tag: '@fast' }, () => {
muradium marked this conversation as resolved.
Show resolved Hide resolved
let course: Course;
let exercise: TextExercise;
let dueDate: dayjs.Dayjs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { expect } from '@playwright/test';
import { ExampleSubmission } from 'app/entities/example-submission.model';
import { TextSubmission } from 'app/entities/text/text-submission.model';

test.describe('Text exercise management', () => {
test.describe('Text exercise management', { tag: '@fast' }, () => {
let course: Course;

test.beforeEach('Create course', async ({ login, courseManagementAPIRequests }) => {
Expand Down
Loading
Loading