compiler

package
v1.0.11864-cf9ad8b Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package compiler helps efficiently compile and cleanup your services in acceptance tests.

This is a small wrapper around the general releases/compiler. The binary created from this package will always be stored in a temporary folder.

To instrument a binary with coverage, the main entry point package must include a TestRunMain func (or similar )in a test file as per the example in internal/cmd/main_test.go. The work added to the compiler must set the WithCoverage flag to true.

For the resultant binary to produce a coverage report it needs to be called with these parameters: "-test.run", "^TestRunMain$", "-test.coverprofile", "your_coverage_name.out" and the service needs to be able to exit cleanly to flush the report. The helper function in testing/runner can make this easier.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parallel

type Parallel struct {
	// contains filtered or unexported fields
}

func NewParallel

func NewParallel(parallelism int) *Parallel

func (*Parallel) Add

func (t *Parallel) Add(work Work)

func (*Parallel) Cleanup

func (t *Parallel) Cleanup()

func (*Parallel) Dir

func (t *Parallel) Dir() string

func (*Parallel) Run

func (t *Parallel) Run(ctx context.Context) error

type Work

type Work = compiler.Work

Directories

Path Synopsis
internal
cmd

Jump to

Keyboard shortcuts

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