Releases: onsi/ginkgo
v2.27.3
v2.27.2
v2.27.1
v2.27.0
2.27.0
Features
Transforming Nodes during Tree Construction
This release adds support for NodeArgsTransformers that can be registered with AddTreeConstructionNodeArgsTransformer.
These are called during the tree construction phase as nodes are constructed and can modify the node strings and decorators. This enables frameworks built on top of Ginkgo to modify Ginkgo nodes and enforce conventions.
Learn more here.
Spec Prioritization
A new SpecPriority(int) decorator has been added. Ginkgo will honor priority when ordering specs, ensuring that higher priority specs start running before lower priority specs
Learn more here.
Maintenance
v2.26.0
2.26.0
Features
Ginkgo can now generate json-formatted reports that are compatible with the go test json format. Use ginkgo --gojson-report=report.go.json. This is not intended to be a replacement for Ginkgo's native json format which is more information rich and better models Ginkgo's test structure semantics.
v2.25.3
v2.25.2
v2.25.1
v2.25.0
2.25.0
AroundNode
This release introduces a new decorator to support more complex spec setup usecases.
AroundNode registers a function that runs before each individual node. This is considered a more advanced decorator.
Please read the docs for more information and some examples.
Allowed signatures:
AroundNode(func())-funcwill be called before the node is run.AroundNode(func(ctx context.Context) context.Context)-funccan wrap the passed in context and return a new one which will be passed on to the node.AroundNode(func(ctx context.Context, body func(ctx context.Context)))-ctxis the context for the node andbodyis a function that must be called to run the node. This gives you complete control over what runs before and after the node.
Multiple AroundNode decorators can be applied to a single node and they will run in the order they are applied.
Unlike setup nodes like BeforeEach and DeferCleanup, AroundNode is guaranteed to run in the same goroutine as the decorated node. This is necessary when working with lower-level libraries that must run on a single thread (you can call runtime.LockOSThread() in the AroundNode to ensure that the node runs on a single thread).
Since AroundNode allows you to modify the context you can also use AroundNode to implement shared setup that attaches values to the context.
If applied to a container, AroundNode will run before every node in the container. Including setup nodes like BeforeEach and DeferCleanup.
AroundNode can also be applied to RunSpecs to run before every node in the suite. This opens up new mechanisms for instrumenting individual nodes across an entire suite.
v2.24.0
2.24.0
Features
Specs can now be decorated with (e.g.) SemVerConstraint("2.1.0") and ginkgo --sem-ver-filter="2.1.1" will only run constrained specs that match the requested version. Learn more in the docs here! Thanks to @Icarus9913 for the PR.
Fixes
Maintenance
Numerous dependency bumps and documentation fixes