utils

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPackageAndName

func GetPackageAndName(pc uintptr) (suite string, name string)

GetPackageAndName gets the suite name and test name given a program counter. Uses runtime.FuncForPC internally to get the full func name of the program counter, then it will split the string by the searching for the latest dot ('.') in the string that separate the full package name from the actual func name. Example 1:

input: github.com/DataDog/dd-sdk-go-testing.TestRun
output:
   suite: github.com/DataDog/dd-sdk-go-testing
   name: TestRun

Example 2:

input: github.com/DataDog/dd-sdk-go-testing.TestRun.func1
output:
   suite: github.com/DataDog/dd-sdk-go-testing
   name: TestRun.func1

func GetProviderTags

func GetProviderTags() map[string]string

GetProviderTags extracts CI information from environment variables.

func OSName

func OSName() string

func OSVersion

func OSVersion() string

Types

type LocalGitData

type LocalGitData struct {
	SourceRoot     string
	RepositoryUrl  string
	Branch         string
	CommitSha      string
	AuthorDate     time.Time
	AuthorName     string
	AuthorEmail    string
	CommitterDate  time.Time
	CommitterName  string
	CommitterEmail string
	CommitMessage  string
}

func LocalGetGitData

func LocalGetGitData() (LocalGitData, error)

LocalGetGitData get the git data from the HEAD in Git repository

Jump to

Keyboard shortcuts

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