Skip to content

Conversation

@kdeakinstructure
Copy link
Contributor

@kdeakinstructure kdeakinstructure commented Oct 1, 2025

Summary

This PR fixes WorkManager-related E2E test failures in Student and Teacher apps by improving WorkManager test infrastructure and handling background task execution in tests.

Key Changes

WorkManager Test Infrastructure

  • Enhanced TestAppManager.kt with proper WorkManager initialization and configuration for tests
  • Added testDriver field for controlling WorkManager constraints in test environment
  • Implemented proper WorkManager test configuration using Configuration.Builder with setTaskExecutor and setExecutor
  • Fixed null pointer exceptions when testDriver is unavailable in CI environment

Test Execution Improvements

  • Updated handleWorkManagerTask() helper function to properly handle null testDriver scenarios
  • Replaced arbitrary sleep() calls with proper handleWorkManagerTask() calls for synchronization
  • Added @FixMethodOrder(MethodSorters.NAME_ASCENDING) to AssignmentsE2ETest for consistent test ordering
  • Refactored test method names with numeric prefixes for deterministic execution order

Fixed Tests

  • testPercentageFileAssignmentWithCommentE2E - Now properly waits for SubmissionWorker completion
  • testMediaCommentsE2E - Replaced sleep calls with proper WorkManager task handling
  • Removed @Stub annotations from previously failing tests

API Enhancements

  • Added CourseAPI.getCourse() method with include parameter support for fetching detailed course information

Configuration Updates

  • Updated Flank YAML configurations across all apps (Student, Teacher, Parent) for improved test execution

Testing

  • Run E2E test suite
  • All previously failing WorkManager-related tests now pass reliably

refs: MBL-18749
affects: Student, Teacher
release note: Fixed WorkManager synchronization in E2E tests

…FileAssignmentWithCommentE2E and testMediaCommentsE2E).

refs: MBL-18749
affects: Student, Teacher
release note:
@inst-danger
Copy link
Contributor

Student Install Page

* Initial plan

* Fix: Handle null testDriver in handleWorkManagerTask

Co-authored-by: kdeakinstructure <[email protected]>

* Restore private-data symlink

Co-authored-by: kdeakinstructure <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: kdeakinstructure <[email protected]>
@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Student Install Page

…ind any workinfos in the second test).

refs: MBL-19357
affects: Student, Teacher, Parent
release note:
@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Student Install Page

…elated test case).

refs: MBL-19357
affects: Student, Teacher, Parent
release note:
@inst-danger
Copy link
Contributor

Student Install Page

@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

refs: MBL-19357
affects: Student, Teacher, Parent
release note:
@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Student Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

refs: MBL-18749
affects: Student, Teacher, Parent
release note:
@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Student Install Page

@inst-danger
Copy link
Contributor

Parent Install Page

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

📊 Code Coverage Report

✅ Student

  • PR Coverage: 43.38%
  • Master Coverage: 43.38%
  • Delta: +0.00%

✅ Teacher

  • PR Coverage: 24.42%
  • Master Coverage: 24.42%
  • Delta: +0.00%

✅ Pandautils

  • PR Coverage: 22.18%
  • Master Coverage: 22.18%
  • Delta: +0.00%

📈 Overall Average

  • PR Coverage: 29.99%
  • Master Coverage: 29.99%
  • Delta: +0.00%

@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Student Install Page

… tests).

refs: MBL-18749
affects: Student, Teacher, Parent
release note:
@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Student Install Page

@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Student Install Page

…-initialization in interaction tests).

refs: MBL-18749
affects: Student
release note:
@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Student Install Page

…thod.

Put E2E annotation on some login E2E tests.

refs: MBL-18749
affects: Student
release note:
@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Student Install Page

… be a bit slower than locally.

refs: MBL-18749
affects: Student
release note:
@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Student Install Page

…tion might causing a problem among shards).

refs: MBL-18749
affects: Student, Teacher, Parent
release note:
refs: MBL-18749
affects: Student, Teacher, Parent
release note:
@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Student Install Page

@kdeakinstructure kdeakinstructure marked this pull request as draft October 20, 2025 14:08
@kdeakinstructure kdeakinstructure added the draft This label is for draft state pull requests. label Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

draft This label is for draft state pull requests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants