Skip to content

Commit

Permalink
add support for GINKGO_TIME_FORMAT
Browse files Browse the repository at this point in the history
  • Loading branch information
onsi committed Oct 29, 2024
1 parent e548367 commit a69eb39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3446,8 +3446,11 @@ When you [filter specs](#filtering-specs) using Ginkgo's various filtering mecha
Here are a grab bag of other settings:

You can disable Ginkgo's color output by running `ginkgo --no-color` or setting the `GINKGO_NO_COLOR=TRUE` environment variable.

You can also output in a format that makes it easier to read in github actions console by running `ginkgo --github-output`.

You can change how Ginkgo formats timestamps in the timeline by setting `GINKGO_TIME_FORMAT` to a valid Golang time format layout (e.g. `GINKGO_TIME_FORMAT=02/01/06 3:04:05.00`).

By default, Ginkgo only emits full stack traces when a spec panics. When a normal assertion failure occurs, Ginkgo simply emits the line at which the failure occurred. You can, instead, have Ginkgo always emit the full stack trace by running `ginkgo --trace`.

### Reporting Infrastructure
Expand Down
10 changes: 9 additions & 1 deletion types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ package types
import (
"encoding/json"
"fmt"
"os"
"sort"
"strings"
"time"
)

const GINKGO_FOCUS_EXIT_CODE = 197
const GINKGO_TIME_FORMAT = "01/02/06 15:04:05.999"

var GINKGO_TIME_FORMAT = "01/02/06 15:04:05.999"

func init() {
if os.Getenv("GINKGO_TIME_FORMAT") != "" {
GINKGO_TIME_FORMAT = os.Getenv("GINKGO_TIME_FORMAT")
}
}

// Report captures information about a Ginkgo test run
type Report struct {
Expand Down

0 comments on commit a69eb39

Please sign in to comment.