Skip to content

Conversation

@lumixraku
Copy link
Contributor

@lumixraku lumixraku commented May 7, 2025

Description

I noticed that the unit tests and E2E tests are currently in the same task. However, as the number of test cases is bound to increase in the future, the test execution time will become longer. I think Jest and E2E tests can be separated into two independent and parallel tasks.


Checklist

General

  • I've included relevant documentation or comments for the changes introduced.
  • I've tested the changes in multiple environments (e.g., different browsers, operating systems).

Testing

  • I've added or updated tests to validate the changes introduced for AppFlowy Web.

Feature-Specific

  • For feature additions, I've added a preview (video, screenshot, or demo) in the "Feature Preview" section.
  • I've verified that this feature integrates seamlessly with existing functionality.

Summary by Sourcery

Split and improve test coverage configuration for AppFlowy Web project

Enhancements:

  • Improved Vite and build configuration for better testing and coverage
  • Updated dependencies and GitHub Actions to latest versions

CI:

  • Updated GitHub Actions workflows to separate E2E and unit test coverage
  • Updated Codecov integration to handle separate coverage reports

Tests:

  • Added separate coverage scripts for unit and component tests
  • Created a new E2E test workflow

Chores:

  • Refactored import statements in various components
  • Updated package.json scripts for more flexible testing

@sourcery-ai
Copy link

sourcery-ai bot commented May 7, 2025

Reviewer's Guide

This PR splits the CI testing: E2E (Cypress) tests are moved to a new e2e.yaml workflow, while web_coverage.yaml now only handles Jest unit tests. Both workflows implement separate Codecov reporting. Code coverage generation is now consistently controlled by a COVERAGE environment variable, which toggles Vite's Istanbul plugin and is used in updated package.json scripts. Key GitHub Actions were also upgraded.

File-Level Changes

Change Details Files
Divided the single test execution workflow into two distinct workflows for unit and E2E tests.
  • Introduced e2e.yaml to handle Cypress E2E test execution and dedicated Codecov reporting.
  • Reconfigured web_coverage.yaml to solely manage Jest unit tests and their Codecov reporting.
  • Updated GitHub Action versions for setup-node, pnpm/action-setup, and codecov/codecov-action.
.github/workflows/web_coverage.yaml
.github/workflows/e2e.yaml
Implemented a COVERAGE environment variable to manage the activation of code coverage.
  • The Istanbul plugin in vite.config.ts is now conditionally enabled via the COVERAGE variable.
  • package.json scripts were added/modified to set this COVERAGE variable for test runs.
  • CI workflows now set COVERAGE="true" for steps involving test execution.
  • Configured distinct Codecov flags (appflowy_web for unit, appflowy_web_e2e for E2E) for coverage reports.
vite.config.ts
package.json
.github/workflows/web_coverage.yaml
.github/workflows/e2e.yaml
Refined Vite's configuration for improved debugging and build outputs.
  • Enhanced esbuild settings (e.g., keepNames, sourcemap) for better sourcemaps and to preserve class/function names.
  • Updated server configuration to set sourcemapIgnoreList to false.
  • Removed the usePluginImport Vite plugin for @mui/icons-material.
vite.config.ts
Applied minor import path corrections and removed some default exports in UI components.
  • Adjusted import paths for the styled utility from @mui/material/styles and the TitleOutlined icon.
  • Converted IndexedDBCleaner and CustomSnackbar components from default to named exports.
src/components/main/withAppWrapper.tsx
src/components/_shared/color-picker/ColorPicker.tsx
src/components/_shared/modal/IndexedDBCleaner.tsx
src/components/_shared/notify/CustomSnackbar.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@lumixraku lumixraku closed this May 7, 2025
@lumixraku lumixraku reopened this May 7, 2025
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @lumixraku - I've reviewed your changes - here's some feedback:

  • Please complete the PR description template to provide context for these changes.
  • The removal of the MUI icon import plugin changes how icons are imported; ensure this new direct import pattern is consistently applied or documented.
  • With E2E coverage moved to e2e.yaml, consider renaming web_coverage.yaml to more accurately reflect its now specific scope (e.g., web_unit_coverage.yaml).
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@lumixraku lumixraku force-pushed the fix/split-test branch 2 times, most recently from 0f090a7 to f228450 Compare May 7, 2025 13:21
@lumixraku lumixraku requested review from qinluhe and richardshiue May 8, 2025 03:31
@lumixraku lumixraku changed the title test: split test feat: split jest test and e2e test May 8, 2025
@lumixraku lumixraku force-pushed the fix/split-test branch 11 times, most recently from 73dbca1 to 6073adf Compare May 8, 2025 10:16
@lumixraku lumixraku force-pushed the fix/split-test branch 3 times, most recently from 85b268e to 11df05e Compare May 8, 2025 15:29
@lumixraku lumixraku force-pushed the fix/split-test branch 2 times, most recently from 8c86e93 to e59c460 Compare May 9, 2025 05:27
@lumixraku lumixraku closed this May 22, 2025
appflowy added a commit that referenced this pull request Nov 14, 2025
Publish/Unpublish/visit Link Test
josue693 pushed a commit to josue693/AppFlowy-Web that referenced this pull request Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant