taskstest

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package taskstest holds an in-memory task store and the contract suite every task store passes.

Index

Constants

This section is empty.

Variables

View Source
var BundledStates = bundledStates{}

BundledStates are the bundled profile's states and verb transitions, for tests that run the service with no profile at hand.

Functions

func Contract

func Contract(t *testing.T, open func(t *testing.T) coretasks.Store)

Contract runs the behavior every coretasks.Store shares; open returns an empty store.

func Full

func Full(id task.ID) task.Task

Full is a task with every field set.

func InState

func InState(s string) task.State

InState is the bundled state named s, for fixtures.

func ProjectsContract

func ProjectsContract(t *testing.T, open func(t *testing.T) (coretasks.Store, coretasks.ProjectStore))

ProjectsContract is the suite every ProjectStore passes; open gives an empty task store and the project store over it.

func PropContract

func PropContract(t *testing.T, open func(t *testing.T) (coretasks.PropStore, func(task.ID)))

PropContract is the suite every coretasks.PropStore passes: open returns a store and a func that creates a task in it.

Types

type Projects

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

Projects is an in-memory coretasks.ProjectStore: the Review's runs.

func (*Projects) CurrentRun

func (p *Projects) CurrentRun(ctx context.Context) (task.ReviewRun, bool, error)

func (*Projects) PutRun

func (p *Projects) PutRun(ctx context.Context, r task.ReviewRun) error

func (*Projects) Runs

func (p *Projects) Runs() []task.ReviewRun

Runs are every run put, oldest first.

type Props

type Props struct {
	Writers map[task.ID]map[string]task.Writer
	// contains filtered or unexported fields
}

Props is an in-memory coretasks.PropStore over the tasks Add names. Writers holds the writer of each property, by task and name.

func NewProps

func NewProps(ids ...task.ID) *Props

func (*Props) Add

func (p *Props) Add(id task.ID)

Add makes id a task SetProp accepts.

func (*Props) PropsOf

func (p *Props) PropsOf(_ context.Context, id task.ID) (task.Props, error)

func (*Props) SetProp

func (p *Props) SetProp(_ context.Context, id task.ID, name string, v task.Value, w task.Writer) error

type Store

type Store struct {
	Notes   int
	Applies int
	Events  []port.Event
	// contains filtered or unexported fields
}

Store is an in-memory coretasks.Store. Notes counts the Applies that changed something, Applies every call.

func New

func New() *Store

func (*Store) Apply

func (s *Store) Apply(ctx context.Context, cs []task.Change, evs ...port.Event) error

func (*Store) Task

func (s *Store) Task(ctx context.Context, id task.ID) (task.Task, error)

func (*Store) Tasks

func (s *Store) Tasks(ctx context.Context, q task.Query) ([]task.Task, error)

func (*Store) TasksOf

func (s *Store) TasksOf(ctx context.Context, u unit.Unit) ([]task.Task, error)

func (*Store) TasksSince

func (s *Store) TasksSince(ctx context.Context, q task.Query, since coretasks.Since) (coretasks.Page, error)

Jump to

Keyboard shortcuts

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