为什么 Rails 5 随机排序测试用例? [英] Why does Rails 5 order test cases randomly?

查看:37
本文介绍了为什么 Rails 5 随机排序测试用例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级指南中提到了Rails 5 将随机订购测试.恢复到固定顺序是微不足道的,但我只是想知道为什么要进行这种更改?是否支持并行测试?

It's mentioned in the upgrade guide Rails 5 will order tests randomly. It's trivial to revert to fixed order, but I'm just wondering why this change was made? Is it to support parallel testing?

推荐答案

随机测试顺序是很好的做法.如果您总是以固定顺序进行测试,则您的测试可能会相互依赖.每个测试都应该没有副作用,随机排序可以保证这一点.

Random test ordering is good practice. If you always do your test in a fixed order there is a chance your tests depend on each other. Each test should have no side effects, and random ordering guarantees this.

这篇关于为什么 Rails 5 随机排序测试用例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆