跳到正文
cccskills
免费在 GitHub 公开中文介绍

test

按 CI 配置运行 SkyWalking 单元测试、集成测试或慢速集成测试。可选择测试类别或 Maven 模块,并了解各命令覆盖的测试、命名规则和标签。

原文查看原文说明

Run unit tests, integration tests, or slow integration tests matching CI. Use to validate changes before submitting a PR.

apache/skywalking星标 24,978(GitHub 24,978 + cccskills 0)

实测评分 未实测

查看安装方法

适用场景

  • 提交 PR 前运行单元测试
  • 运行不含慢速测试的集成测试
  • 只测试一个 Maven 模块
  • 运行 Elasticsearch 或 OpenSearch 慢速测试

中文介绍

功能

本技能介绍如何按照 CI 配置运行 SkyWalking 的单元测试、集成测试和慢速集成测试。不带参数或指定 unit 时运行单元测试;指定 integration 时运行不含慢速测试的集成测试;指定 slow 时运行慢速测试。也可以输入模块名称,只运行该模块的测试。资料还说明了测试命名规则、Maven 执行阶段,以及用 @Tag("slow") 标记测试的方式,帮助了解每条命令会运行哪些测试。

适用场景

提交 PR 前,想用 CI 对应的测试类别检查变更时,可以使用本技能。在运行整套测试之前先检查某个模块,或单独运行常规集成测试任务会排除的 Elasticsearch/OpenSearch 测试时,也可以参考这些命令。

使用示例

  • “运行单元测试,检查我的改动。”
  • “运行不包含慢速测试的集成测试。”
  • “告诉我这个模块的集成测试命令。”

注意事项

命令使用 Maven Wrapper。CI 中不同测试类别的 JDK 和操作系统条件有所不同。测试在本地失败时,资料建议先调查原因,不要依赖 CI 重试来掩盖间歇性问题。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

文档检查

AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。

安全性发送数据、删除文件、执行命令等是否有说明
A良好命令限定了测试范围,资料也建议调查失败原因。
安装难易度所需工具和 API 密钥是否少且有说明
B部分不足资料使用 Maven Wrapper 并列出 CI 的 JDK 和系统条件,但未给出安装步骤。

不计入评分。 由 AI(OpenAI Codex)于 2026年10月29日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(1)

  • SKILL.md2.4 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Tests

Run tests matching CI configuration.

Commands by argument

unit or no argument — unit tests

./mvnw clean test -q -B -D"checkstyle.skip"

CI runs this on:

  • JDK 11: ubuntu, macOS, Windows
  • JDK 17, 21, 25: ubuntu only

integration — integration tests (excludes slow)

./mvnw -B clean integration-test -Dcheckstyle.skip -DskipUTs=true -DexcludedGroups=slow

CI runs this on JDK 11, 17, 21, 25 (ubuntu only).

slow — slow integration tests

./mvnw -B clean integration-test -Dcheckstyle.skip -DskipUTs=true \
  -Dit.test=org.apache.skywalking.library.elasticsearch.ElasticSearchIT \
  -Dfailsafe.failIfNoSpecifiedTests=false

CI runs on JDK 11 (ubuntu only). Currently only ElasticSearch/OpenSearch IT is in the slow matrix.

Module name — single module tests

# Unit tests for a specific module
./mvnw clean test -pl oap-server/analyzer/<module-name> -D"checkstyle.skip"

# Integration tests for a specific module
./mvnw -B clean integration-test -pl oap-server/analyzer/<module-name> -Dcheckstyle.skip -DskipUTs=true

Test frameworks

  • JUnit 5 (org.junit.jupiter)
  • Mockito for mocking
  • AssertJ for assertions
  • PowerMock for reflection utilities

Test naming conventions

TypePatternMaven phase
Unit tests*Test.javatest
Integration testsIT*.java or *IT.javaintegration-test

Slow test tagging

Tests tagged with @Tag("slow") are excluded from the normal integration-test job and run separately in the slow-integration-test job. Use this tag for tests that spin up external services (Elasticsearch, etc.) and take significant time.

CI retry behavior

All three CI jobs retry on failure (run the same command twice with ||). This handles flaky tests but masks intermittent issues — if a test fails locally, investigate rather than relying on retries.

CI reference

CI workflow: .github/workflows/skywalking.yaml

JobJDKOSTimeout
unit-test11 (3 OS) + 17, 21, 25 (ubuntu)ubuntu, macOS, Windows30 min
integration-test11, 17, 21, 25ubuntu60 min
slow-integration-test11ubuntu60 min

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

ci-e2e-debug

免费有简介

用于排查 GitHub Actions 中失败的端到端测试。它会获取并解压运行日志,检查 OAP 及其他组件的错误,并整理可能的原因,包括独立测试进程中的故障。

  • 排查 GitHub Actions 中失败的端到端测试
  • 检查 OAP、BanyanDB 或 UI 日志
  • 追踪独立测试进程的故障
apache/skywalking2.5万2026年10月29日 更新

compile

免费有简介

通过 Maven 包装器构建 SkyWalking OAP,并检查 Javadoc 和 Checkstyle。可选择全量、后端、单个模块构建或单项检查,用于提交 PR 前验证改动。

  • 提交 PR 前运行全量构建
  • 检查 Javadoc 错误和警告
  • 只构建修改过的模块
apache/skywalking2.5万2026年10月29日 更新

generate-classes

免费有简介

编译 SkyWalking 的 MAL、OAL、LAL 或 Hierarchy DSL 脚本,并输出生成的 `.class` 文件供检查。可选择一种 DSL,也可生成全部四种,再用 `javap` 查看字节码。

  • 检查 MAL 表达式生成的类
  • 查看 OAL 指标和分发器类
  • 检查 LAL 或 Hierarchy 输出
apache/skywalking2.5万2026年10月29日 更新

gh-pull-request

免费有简介

在推送前检查构建、Checkstyle、许可证标头和 Java 类名写法,修复问题后提交并推送分支;若当前分支尚无 PR,则按项目模板创建。

  • 提交 PR 前检查改动
  • 提交并推送分支改动
  • 从当前分支创建 PR
apache/skywalking2.5万2026年10月29日 更新

license

免费有简介

用 `license-eye` 检查源文件的 Apache 2.0 标头和依赖许可证清单;可修复标头、重新生成清单,并在提交 PR 前核对差异。

  • 提交 PR 前检查 Apache 标头
  • 修复缺失的许可证标头
  • 核对依赖许可证清单差异
apache/skywalking2.5万2026年10月29日 更新

new-monitoring-feature

免费有简介

为 SkyWalking OAP 增加监控对象或 Layer 时,梳理不同信号对应的扩展点,并列出 Layer 注册、界面模板、文档和本地验证等相关工作。

  • 规划新增监控 Layer 的改动
  • 选择指标或日志的扩展点
  • 整理 Layer 相关界面和文档更新
apache/skywalking2.5万2026年10月29日 更新

查看 apache 的全部技能

报告此技能的问题