eventually-checker

command
v0.0.0-...-a7b7215 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: UPL-1.0 Imports: 8 Imported by: 0

README

Eventually Checker

This tool is used to scan tests that use the gomega and ginkgo packages and checks for calls that will force gomega.Eventually calls to exit prematurely. Specifically, it looks for ginkgo.Fail and gomega.Expect calls in call trees rooted by gomega.Eventually.

Usage

go run check_eventually.go [options] path

Options:
  -report   report on problems but always exits with a zero status code

Running the Checker

The tool is integrated into the Verrazzano top-level Makefile in the check-tests target. Use make check-tests or run the tool manually. For example, to run the tool against the acceptance tests:

$ go run tools/eventually-checker/check_eventually.go tests/e2e

If the tool finds suspect calls, it displays the locations of those calls along with the locations of the Eventually calls. For example:

$ go run tools/eventually-checker/check_eventually.go tools/eventually-checker/test/

eventuallyChecker: Fail/Expect at /go/src/github.com/verrazzano/verrazzano/tools/eventually-checker/test/internal/helper.go:12:2
    called from Eventually at:
        /go/src/github.com/verrazzano/verrazzano/tools/eventually-checker/test/main.go:14:3

eventuallyChecker: Fail/Expect at /go/src/github.com/verrazzano/verrazzano/tools/eventually-checker/test/main.go:32:2
    called from Eventually at:
        /go/src/github.com/verrazzano/verrazzano/tools/eventually-checker/test/main.go:23:3

Documentation

Overview

Copyright (c) 2021, 2022, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL