gotest/

directory
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT, Apache-2.0

README ยถ

GoTest Module for Dagger

Dagger Version

A simple Dagger module that wraps Go testing functionality to run Go tests within a containerized environment.

Configuration ๐Ÿ› ๏ธ

Through the Dagger CLI, or by using it directly within your module, you can configure the following options:

  • โš™๏ธ src: The path to the Go source code directory.
  • โš™๏ธ ctr: The container to use as a base container. If not specified, a new container is created.
  • โš™๏ธ version: The version of the Go image to use. Defaults to latest.
  • โš™๏ธ image: The Go image to use. Defaults to golang:alpine.
  • โš™๏ธ envVarsFromHost: Environment variables to pass from the host to the container.

Features ๐ŸŽจ

Command or functionality Command Example Status
Run Go Tests run dagger call run-go-test --packages="./..." --enableVerbose=true --race=true --src="my-code/src" โœ…
Run GoTestSum runsum dagger call run-go-test-sum --src="mydir/src" --race=true --testFlags="-json" --goTestSumFlags="--format=short-verbose" --format="short" --enablePretty=true โœ…

Using the GoTest Module

This module allows you to integrate Go testing into your Dagger pipelines easily. To use it, simply specify the source directory and the desired command. The module can execute various Go testing functions, including running tests and using gotestsum for advanced test result formatting.

Additional Information
  • GoTestSum: GoTestSum is a tool for running and summarizing Go tests. More details can be found in the GoTestSum Documentation.
  • Dagger: Dagger is a portable devkit for CI/CD pipelines, allowing you to define your pipeline as code and execute it anywhere. For more on Dagger, visit Dagger.io.

Usage ๐Ÿš€

dagger call run-go-test --src="../../test/testdata/gotest" \
--test-flags="--json" --enable-cache;

dagger call --verbose run-go-test-sum --src="../../test/testdata/gotest" \
--enable-pretty --enable-cache;

Directories ยถ

Path Synopsis

Jump to

Keyboard shortcuts

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