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

chore: update to support taro e2e test #2856

Merged
merged 6 commits into from
Dec 13, 2024

Conversation

Alex-huxiyang
Copy link
Collaborator

@Alex-huxiyang Alex-huxiyang commented Dec 12, 2024

update ci.yml to support taro e2e test

Summary by CodeRabbit

  • 新功能
    • 添加了针对 Taro 的 E2E 测试工作流步骤。
    • 新增开发脚本 "dev:taro:h5" 以支持 Taro 框架的 H5 开发。
  • 修复
    • 更新了 E2E 测试脚本的引用,确保正确性。
    • 修改了组件过滤逻辑,增强了基于 param 变量的组件包含灵活性。

Copy link

coderabbitai bot commented Dec 12, 2024

Walkthrough

此拉取请求对多个文件进行了修改,主要集中在增强与Taro框架相关的E2E测试和开发工作流程。在.github/workflows/cypress.yml中添加了新的作业步骤以运行Taro的E2E测试。cypress/e2e/taro/index.cy.js中移除了不必要的导入。package.json文件中添加了新的开发脚本,并更新了现有的E2E运行脚本。最后,scripts/rn/update-taro-entry.js中对组件过滤逻辑进行了调整,以增强灵活性。

Changes

文件路径 修改摘要
.github/workflows/cypress.yml 添加新作业步骤:运行E2E测试(pnpm e2e:run:taro),并设置环境变量CItrue
cypress/e2e/taro/index.cy.js 移除导入:import { describe } from 'yargs'。保留测试逻辑不变。
package.json 添加新脚本:"dev:taro:h5": "pnpm dev:taro h5";更新脚本:"e2e:open:taro""e2e:run:taro"
scripts/rn/update-taro-entry.js 修改specialComponent函数,新增条件以检查param变量,调整组件过滤逻辑。

Sequence Diagram(s)

sequenceDiagram
    participant CI
    participant Cypress
    participant Taro
    CI->>Cypress: 安装Cypress
    Cypress->>Taro: 运行E2E测试
    Taro->>Cypress: 返回测试结果
Loading

Possibly related PRs

Suggested labels

size/XXL

Suggested reviewers

  • oasis-cloud
  • xiaoyatong

Poem

在兔子洞里忙碌着,
Taro测试新步伐,
脚本更新真精彩,
CI工作流更顺畅,
兔子欢跳庆变化! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 33df328 and 848d728.

📒 Files selected for processing (1)
  • package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Experiment)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the 3.x Target branch 3.x label Dec 12, 2024
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.56%. Comparing base (fe50c4b) to head (848d728).
Report is 2 commits behind head on feat_v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #2856   +/-   ##
==========================================
  Coverage      84.56%   84.56%           
==========================================
  Files            273      273           
  Lines          18609    18609           
  Branches        2693     2693           
==========================================
  Hits           15737    15737           
  Misses          2867     2867           
  Partials           5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Alex-huxiyang Alex-huxiyang marked this pull request as draft December 12, 2024 02:38
@Alex-huxiyang Alex-huxiyang marked this pull request as ready for review December 12, 2024 02:41
@Alex-huxiyang Alex-huxiyang marked this pull request as draft December 12, 2024 02:41
@Alex-huxiyang Alex-huxiyang marked this pull request as ready for review December 12, 2024 03:04
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (1)
scripts/rn/update-taro-entry.js (1)

11-13: 建议增加参数验证和文档说明

当前修改允许在未指定参数时包含所有组件,这提供了更大的灵活性。但建议:

  1. 添加日志输出,明确说明当前使用的过滤模式
  2. 在代码注释中说明这种行为的目的和影响

建议按如下方式优化代码:

 function specialComponent(name) {
-  if(!param) return true
+  if(!param) {
+    console.log('未指定组件过滤参数,将包含所有组件')
+    return true
+  }
   const entries = param.split(',').map((i) => i.toLowerCase())
+  console.log(`正在过滤组件,包含: ${entries.join(', ')}`)
   return entries.includes(name.toLowerCase())
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 2379833 and f4e4d4f.

📒 Files selected for processing (4)
  • .github/workflows/cypress.yml (1 hunks)
  • cypress/e2e/taro/index.cy.js (0 hunks)
  • package.json (2 hunks)
  • scripts/rn/update-taro-entry.js (1 hunks)
💤 Files with no reviewable changes (1)
  • cypress/e2e/taro/index.cy.js
🔇 Additional comments (2)
.github/workflows/cypress.yml (1)

32-35: 新增的 Taro E2E 测试步骤配置正确!

工作流程配置遵循了与 H5 测试相同的模式,保持了一致性。

运行以下脚本以验证 package.json 中的测试命令:

✅ Verification successful

Taro E2E 测试命令已正确配置在 package.json 中!

在 package.json 中找到了 e2e:run:taro 命令,它使用 start-server-and-test 来:

  • 启动 Taro H5 开发服务器(dev:taro:h5
  • 等待服务器在 http://localhost:10086 就绪
  • 运行 Taro 的 Cypress 测试(cypress:run:taro
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:验证 package.json 中是否存在 e2e:run:taro 命令
# 预期结果:找到 "e2e:run:taro" 脚本定义

jq -r '.scripts["e2e:run:taro"]' package.json

Length of output: 121

package.json (1)

61-61: 新增的 Taro H5 开发脚本配置正确!

新增的 dev:taro:h5 脚本与 CI 工作流程的变更保持一致。

@Alex-huxiyang Alex-huxiyang changed the title chore: update ci to support taro e2e test chore: update to support taro e2e test Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Target branch 3.x size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants