How to `go test` all tests in my project?

This should run all tests in current directory and all of its subdirectories: $ go test ./… This should run all tests for given specific directories: $ go test ./tests/… ./unit-tests/… ./my-packages/… This should run all tests with import path prefixed with foo/: $ go test foo/… This should run all tests import path prefixed … Read more

Gradle: How to Display Test Results in the Console in Real Time?

Here is my fancy version: import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent tasks.withType(Test) { testLogging { // set options for log level LIFECYCLE events TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.STANDARD_OUT exceptionFormat TestExceptionFormat.FULL showExceptions true showCauses true showStackTraces true // set options for log level DEBUG and INFO debug { events TestLogEvent.STARTED, TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.STANDARD_ERROR, TestLogEvent.STANDARD_OUT exceptionFormat TestExceptionFormat.FULL } info.events … Read more

What’s the difference between unit, functional, acceptance, and integration tests? [closed]

Depending on where you look, you’ll get slightly different answers. I’ve read about the subject a lot, and here’s my distillation; again, these are slightly wooly and others may disagree. Unit Tests Tests the smallest unit of functionality, typically a method/function (e.g. given a class with a particular state, calling x method on the class … Read more

What’s the difference between a mock & stub?

Foreword There are several definitions of objects, that are not real. The general term is test double. This term encompasses: dummy, fake, stub, mock. Reference According to Martin Fowler’s article: Dummy objects are passed around but never actually used. Usually they are just used to fill parameter lists. Fake objects actually have working implementations, but … Read more