You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tests in go-ucfg use the .../testify/assert package for validation, but sometimes also for checking on intermediate errors. The assert package only logs an error to *testing.T, but continues the test run. If there is a dependency on an operation to succeed (e.g. calling NewFrom), then the test should fail immediately pointing out the failing line in code. This can be achieved by using t.Fatal(f), use .../testify/require instead of assert, or use constructors that can panic like MustNewFrom instead of NewFrom.
By not failing and returning the test early, there might be a chance that validation/operations will panic. In this case the errors/logs stored in *testing.T will not be written to console, and the actual failure can't be inspected.
The text was updated successfully, but these errors were encountered:
Note: testify package is basically everywhere. Not just in go-ucfg, but it is also used by many other projects. For sake of consistency we should switch to require.X instead of trying to get rid or replace testify.
The tests in go-ucfg use the
.../testify/assert
package for validation, but sometimes also for checking on intermediate errors. Theassert
package only logs an error to*testing.T
, but continues the test run. If there is a dependency on an operation to succeed (e.g. callingNewFrom
), then the test should fail immediately pointing out the failing line in code. This can be achieved by usingt.Fatal(f)
, use.../testify/require
instead ofassert
, or use constructors that can panic likeMustNewFrom
instead ofNewFrom
.By not failing and returning the test early, there might be a chance that validation/operations will panic. In this case the errors/logs stored in
*testing.T
will not be written to console, and the actual failure can't be inspected.The text was updated successfully, but these errors were encountered: