coverage

package
v0.0.0-...-4fb5945 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

README

This directory contains the coverage service implementation and it's respective controllers.

The service has 4 endpoints.

  1. GetTestSuite
  2. InsertFile
  3. DeleteFile
  4. UpdateFile

Run CockroachDB

cd /tmp && cockroach start-single-node --insecure --listen-addr=127.0.0.1

Running the coverage service locally

To run a local instance of the coverage service, simply run the cmd below from the coverage directory. make run-coverage

How to use the endpoints

grpc_cli call 127.0.0.1:8006 --channel_creds_type=local coverage.v1.CoverageService.<RPC> --infile demo/<ACTION>.json

  1. GetTestSuite
    • This method returns available test suites based on Source file and Builder.
  2. InsertFile
    • Used when a new file and builder will be added to database.
  3. DeleteFile
    • Remove existing file and builder pair.
  4. UpdateFile
    • Add test suite to existing file and builder pair.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCockroachDBFromConfig

func NewCockroachDBFromConfig(ctx context.Context, coverageConfig *config.CoverageConfig) (pool.Pool, error)

NewCockroachDBFromConfig opens an existing CockroachDB database.

func NewCoverageService

func NewCoverageService(coverageStore coveragestore.Store) *coverageService

New returns a new instance of the coverage service.

func NewCoverageStoreFromConfig

func NewCoverageStoreFromConfig(ctx context.Context, coverageConfig *config.CoverageConfig) (coveragestore.Store, error)

NewCoverageStoreFromConfig creates a new coverage.Store from the CoverageConfig which provides access to the coverage data.

Types

type Coverage

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

Coverage provides a struct for the application.

func New

func New(config *config.CoverageConfig,
	coverageStore coveragestore.Store) (*Coverage, error)

New creates a new instance of Coverage application.

func (*Coverage) Cleanup

func (c *Coverage) Cleanup()

Cleanup performs a graceful shutdown of the grpc server.

func (*Coverage) Serve

func (c *Coverage) Serve()

Serve intiates the listener to serve traffic.

func (*Coverage) ServeGRPC

func (c *Coverage) ServeGRPC() error

ServeGRPC does not return unless there is an error during the startup process, in which case it returns the error, or if a call to [Cleanup()] causes a graceful shutdown, in which case it returns either nil if the graceful shutdown succeeds, or an error if it does not.

type CoverageService

type CoverageService interface {
	// RegisterGrpc registers the grpc service with the server instance.
	RegisterGrpc(server *grpc.Server)
	// GetServiceDescriptor returns the service descriptor for the service.
	GetServiceDescriptor() grpc.ServiceDesc
}

CoverageService provides an interface for a service to be hosted on Coverage application.

Directories

Path Synopsis
sqlcoveragestore/tosql
This executable generates a go file that contains the SQL schema for machineserver defined as a string.
This executable generates a go file that contains the SQL schema for machineserver defined as a string.
This application creates the 'coverage' database on a local CockroachDB instance and also applies the latest schema.
This application creates the 'coverage' database on a local CockroachDB instance and also applies the latest schema.
proto
v1

Jump to

Keyboard shortcuts

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