# 需要插件的插件测试

**URL:** https://meta.discourse.org/t/tests-for-plugin-that-requires-a-plugin/255406
**Category:** Development
**Created:** [2023年二月16日 22:12 UTC](https://meta.discourse.org/t/tests-for-plugin-that-requires-a-plugin/255406 "2023-02-16T22:12:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2023年二月16日 22:12 UTC](https://meta.discourse.org/t/tests-for-plugin-that-requires-a-plugin/255406/1 "2023-02-16T22:12:10Z")

</div>

我看到 discourse-plugin-skeleton 现在有了这个：

```
      uses: discourse/.github/.github/workflows/discourse-plugin.yml@v1

```

这样我们就不用一直更新东西了。但是我的一个插件需要 subscriptions 插件，所以我想我还是需要把 `discourse/discourse/.github/workflows` 的东西复制到我的插件里，对吧？

我想不出有什么巧妙的方法可以让我的插件声明包含 subscriptions，对吧？

另外，它加载 `stree` 时失败了。我现在只是删除了 `.stree.rc` 文件。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2023年二月28日 16:10 UTC](https://meta.discourse.org/t/tests-for-plugin-that-requires-a-plugin/255406/2 "2023-02-28T16:10:36Z")

</div>

我终于明白了。答案就在[这里](https://github.com/discourse/.github/blob/main/actions/clone-additional-plugins/action.yml)。解决方案是创建一个 `about.json` 文件，如下所示：

```plaintext
{ "tests": {
    "requiredPlugins": [
      "https://github.com/discourse/discourse-subscriptions"
    ]
  }
}

```

现在我的测试又通过了！🎉

我仍然不知道 `stree` 是什么。

既然我已经解决了这个问题，我对它的工作方式感到非常满意！

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2023年三月30日 16:11 UTC](https://meta.discourse.org/t/tests-for-plugin-that-requires-a-plugin/255406/3 "2023-03-30T16:11:00Z")

</div>

此主题在上次回复后 30 天自动关闭。不再允许回复。
