unit-testing - 如何在 Ansible 中进行单元测试?

标签 unit-testing ansible

关闭。这个问题需要更多focused .它目前不接受答案。












想改善这个问题吗?更新问题,使其仅关注一个问题 editing this post .

3年前关闭。




Improve this question




One of the Ansible documentation表示:

Obviously at the development stage, unit tests are great too.



如果我在同一文档中查询单元测试,则找不到任何内容。例如,在 Ansible 中是否有等效的 rspec-puppet?

最佳答案

如果你正在做光谱测试,我发现最容易使用的工具是 goss。它是 golang 中的单个二进制文件。它非常快,测试是用 yaml 编写的。它消除了为您的测试和抽象的编程。
https://github.com/aelsabbahy/goss

作者有一个简单的屏幕gif来展示用法。

关于unit-testing - 如何在 Ansible 中进行单元测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38313220/

相关文章:

WCF 序列化单元测试和此 XmlWriter 不支持 base64 编码数据。我应该使用什么 Writer?

vb.net - Jenkins 抛出未知的汇编错误

java - 将 @Mock 注入(inject)另一个 @Mock 或重构?

php - 您如何管理项目中的单元测试文件?你在git中添加它们吗?

ssh - Ansible :Unable to parse/etc/ansible/hosts as an inventory source

ansible - 为什么我的 Ansible 任务挂起?

java - 模拟文件系统有必要吗?

linux - 无法使用 Ansible 更新 sshd 配置文件

ansible - 使用 jinja2 比较版本号

parsing - 有没有办法 grep 或解析 ansible 变量