mapping

package
v0.0.0-...-47b7049 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Github int = 0
	Jira   int = 1
)

A const for backlog item sources

Variables

This section is empty.

Functions

This section is empty.

Types

type BacklogItem

type BacklogItem struct {
	Source int
	ID     string
}

BacklogItem is a requirement definition from a project management system

func GetBacklogItem

func GetBacklogItem(m string) []BacklogItem

GetBacklogItem constructs one or more BacklogItems from a traceability sourcecode comment

func (BacklogItem) GetGitHubIssue

func (bi BacklogItem) GetGitHubIssue() (string, error)

GetGitHubIssue returns the GitHub issue from a backlog item

func (BacklogItem) GetGitHubOrganization

func (bi BacklogItem) GetGitHubOrganization() (string, error)

GetGitHubOrganization returns the GitHub organization from a backlog item

func (BacklogItem) GetGitHubRepository

func (bi BacklogItem) GetGitHubRepository() (string, error)

GetGitHubRepository retruns the GitHub repository from a backlog item

func (BacklogItem) GetIssueURL

func (bi BacklogItem) GetIssueURL(cfg utils.Config) string

GetIssueURL returns the GitHub issue or Jira backlogitem URL

func (BacklogItem) GetTraceabilityRepoPath

func (bi BacklogItem) GetTraceabilityRepoPath() string

GetTraceabilityRepoPath retruns the traceability repository path from a backlog item

type GaugeSpecParser

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

* GaugeSpecParser:

func (GaugeSpecParser) Parse

func (gsp GaugeSpecParser) Parse(cfg utils.Config, sc utils.Sourcecode) []TestBacklog

func (GaugeSpecParser) ParseContent

func (gsp GaugeSpecParser) ParseContent(spec io.Reader, cfg utils.Config, sc utils.Sourcecode, file *os.File) []TestBacklog

type GaugeTestCaseMatcher

type GaugeTestCaseMatcher struct{}

func (GaugeTestCaseMatcher) Matches

func (gtcm GaugeTestCaseMatcher) Matches(tb *TestBacklog, tc *testreport.TestCase) bool

type JSONMappingFile

type JSONMappingFile struct {
}

JSONMappingFile is a parser for JSON mapping file (which map Backlog items to automated test classes). Pls. note, that this class does NOT implement the mapping.Parser interface

func (JSONMappingFile) Parse

func (mf JSONMappingFile) Parse(cfg utils.Config) []TestBacklog

Parse JSON mapping files of format: [

{
  "source_reference": "com.myCompany.myApp.myJavaTest",
  "jira_keys": [
    "MYJIRAPROJECT-3"
  ]
},
{
  "source_reference": "com.myCompany.myApp.myJavaTest.myMethod()",
  "github_keys": [
    "myOrg/mySourcecodeRepo#1"
  ]
},
{
  "source_reference": "com.myCompany.myApp.myJavaTest.myOtherMethod()",
  "filelocation": {
      "git": {
        "organization": "myOrg",
        "repository": "mySourcecodeRepo",
        "branch": "master"
      },
      "relativePath": "./src/test/java/com/myCompany/myApp/myJavaTest.java"
  },
  "jira_keys": [
    "MYJIRAPROJECT-1",
    "MYJIRAPROJECT-2"
  ],
  "github_keys": [
    "myOrg/mySourcecodeRepo#2"
  ]
}

]

type JSParser

type JSParser struct {
}

JSParser implements the mapping.Parser interface for JavaScript sourcecode

func (JSParser) Parse

func (jp JSParser) Parse(cfg utils.Config, sc utils.Sourcecode) []TestBacklog

Parse JavaScript sourcecode to seek for traceability comments

type JavaParser

type JavaParser struct {
}

JavaParser implements the mapping.Parser interface for Java sourcecode Known limitations: Multiple test classes in one Java file won't get processed right (not sure if that use case makes sense at all)

func (JavaParser) Parse

func (jp JavaParser) Parse(cfg utils.Config, sc utils.Sourcecode) []TestBacklog

Parse java sourcecode to seek for traceability comments

type Parser

type Parser interface {
	Parse(cfg utils.Config, sc utils.Sourcecode) []TestBacklog
}

Parser interface for programming language dependend parsers. cfg is complete configuration. sc is sourcecode repo/local path of current run

type PythonParser

type PythonParser struct {
}

PythonParser implements the mapping.Parser interface for Python sourcecode

func (PythonParser) Parse

func (jp PythonParser) Parse(cfg utils.Config, sc utils.Sourcecode) []TestBacklog

Parse python sourcecode to seek for traceability comments

type Test

type Test struct {
	FileURL   string
	ClassName string
	Method    string
}

Test is an automated test defined by a file, classname and method (which could be empty if complete class should be tested)

type TestBacklog

type TestBacklog struct {
	Test            Test
	BacklogItem     []BacklogItem
	TestCaseMatcher TestCaseMatcher
}

TestBacklog maps an automated test to one or more backlogitems

func (*TestBacklog) Matches

func (tb *TestBacklog) Matches(tc *testreport.TestCase) bool

type TestCaseMatcher

type TestCaseMatcher interface {
	Matches(*TestBacklog, *testreport.TestCase) bool
}

Jump to

Keyboard shortcuts

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