简体   繁体   English

Salesforce:在 DE org 中部署时启用 75% 的测试覆盖率

[英]Salesforce : Enable 75% test coverage while deployment in DE org

I'm using sfdx to deploy my components and classes to a developer edition org, but while deploying it doesn't check 75% test coverage of apex classes, is there any setting to enable test coverage while deployment or DE Org doesn't support test coverage checks while deployment?我正在使用 sfdx 将我的组件和类部署到开发人员版组织,但是在部署时它不会检查 75% 的顶点类测试覆盖率,是否有任何设置可以在部署或 DE 组织不支持时启用测试覆盖率部署时测试覆盖率检查?

You can deploy to developer edition / trailhead playground orgs without code coverage or edit apex straight in "prod" (in setup or developer console).您可以在没有代码覆盖的情况下部署到开发人员版/ Trailhead Playground 组织,或直接在“prod”(在设置或开发人员控制台中)编辑 apex。 Developer Editions have no sandboxes and concept of scratch orgs is relatively new so being able to work in "prod" was the only option.开发人员版没有沙箱,并且临时组织的概念相对较新,因此能够在“prod”中工作是唯一的选择。 Plus well, it helps with rapid prototyping of ideas without the "hurdle" of unit tests.另外,它有助于快速制作创意原型,而没有单元测试的“障碍”。

If you'd be eventually making a managed package - don't worry.如果您最终要制作托管 package - 别担心。 During process of packaging new version you'd have the usual checks (does everything compile, do all tests pass, 75% overall and at least 1% on triggers).在打包新版本的过程中,您将进行常规检查(是否所有内容都编译,是否通过所有测试,总体为 75%,触发器至少为 1%)。

You can choose to run local tests while deploying but I don't think there's native way to enforce 75% threshold.您可以选择在部署时运行本地测试,但我认为没有本地方法可以强制执行 75% 的阈值。 Maybe something in your CI tool could help (GitHub actions or what have you)也许您的 CI 工具中的某些东西可以提供帮助(GitHub 操作或您有什么)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM