testutils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggerMock

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

func (*LoggerMock) Debugf

func (l *LoggerMock) Debugf(format string, args ...interface{})

func (*LoggerMock) Errorf

func (l *LoggerMock) Errorf(err error, format string, args ...interface{})

func (*LoggerMock) Infof

func (l *LoggerMock) Infof(format string, args ...interface{})

func (*LoggerMock) New

func (l *LoggerMock) New(fields log.Fields) log.Logger

func (*LoggerMock) Next

func (l *LoggerMock) Next() string

func (*LoggerMock) Warningf

func (l *LoggerMock) Warningf(format string, args ...interface{})

func (*LoggerMock) With

func (l *LoggerMock) With(fields log.Fields) log.Logger

type Memory

type Memory struct {
	Organization     *graphql.Organization
	Repository       *graphql.RepositoryFields
	Topics           []string
	Users            []*graphql.UserExtended
	Issues           []*graphql.Issue
	IssueComments    []*graphql.IssueComment
	PRs              []*graphql.PullRequest
	PRComments       []*graphql.IssueComment
	PRReviews        []*graphql.PullRequestReview
	PRReviewComments []*graphql.PullRequestReviewComment
}

Memory implements the storer interface

func (*Memory) Begin

func (s *Memory) Begin() error

Begin is a noop method at the moment

func (*Memory) Cleanup

func (s *Memory) Cleanup(ctx context.Context, currentVersion int) error

Cleanup is a noop method at the moment

func (*Memory) Commit

func (s *Memory) Commit() error

Commit is a noop method at the moment

func (*Memory) Rollback

func (s *Memory) Rollback() error

Rollback is a noop method at the moment

func (*Memory) SaveIssue

func (s *Memory) SaveIssue(ctx context.Context, repositoryOwner, repositoryName string, issue *graphql.Issue, assignees []string, labels []string) error

SaveIssue appends an issue to the issue list in memory

func (*Memory) SaveIssueComment

func (s *Memory) SaveIssueComment(ctx context.Context, repositoryOwner, repositoryName string, issueNumber int, comment *graphql.IssueComment) error

SaveIssueComment appends an issue comment to the issue comments list in memory

func (*Memory) SaveOrganization

func (s *Memory) SaveOrganization(ctx context.Context, organization *graphql.Organization) error

SaveOrganization stores an organization in memory, it also initializes the list of users

func (*Memory) SavePullRequest

func (s *Memory) SavePullRequest(ctx context.Context, repositoryOwner, repositoryName string, pr *graphql.PullRequest, assignees []string, labels []string) error

SavePullRequest appends an PR to the PR list in memory, also initializes the map for the review commnets for that particular PR

func (*Memory) SavePullRequestComment

func (s *Memory) SavePullRequestComment(ctx context.Context, repositoryOwner, repositoryName string, pullRequestNumber int, comment *graphql.IssueComment) error

SavePullRequestComment appends an PR comment to the PR comment list in memory

func (*Memory) SavePullRequestReview

func (s *Memory) SavePullRequestReview(ctx context.Context, repositoryOwner, repositoryName string, pullRequestNumber int, review *graphql.PullRequestReview) error

SavePullRequestReview appends a PR review to the PR review list in memory

func (*Memory) SavePullRequestReviewComment

func (s *Memory) SavePullRequestReviewComment(ctx context.Context, repositoryOwner, repositoryName string, pullRequestNumber int, pullRequestReviewID int, comment *graphql.PullRequestReviewComment) error

SavePullRequestReviewComment appends a PR review comment to the PR review comments list in memory

func (*Memory) SaveRepository

func (s *Memory) SaveRepository(ctx context.Context, repository *graphql.RepositoryFields, topics []string) error

SaveRepository stores a repository and its topics in memory and initializes PRs and PR comments

func (*Memory) SaveUser

func (s *Memory) SaveUser(ctx context.Context, orgID int, orgLogin string, user *graphql.UserExtended) error

SaveUser appends a user to the user list in memory

func (*Memory) SetActiveVersion

func (s *Memory) SetActiveVersion(ctx context.Context, v int) error

SetActiveVersion is a noop method at the moment

func (*Memory) Version

func (s *Memory) Version(v int)

Version is a noop method at the moment

type OrganizationTestOracle

type OrganizationTestOracle struct {
	Org               string `json:"org"`
	Version           int    `json:"version"`
	URL               string `json:"url"`
	CreatedAt         string `json:"createdAt"`
	PublicRepos       int    `json:"publicRepos"`
	TotalPrivateRepos int    `json:"totalPrivateRepos"`
	NumOfUsers        int    `json:"numOfUsers"`
}

OrganizationTestOracle struct to hold a test oracle for an organization

type RepositoryTestOracle

type RepositoryTestOracle struct {
	Owner                 string   `json:"owner"`
	Repository            string   `json:"repository"`
	Version               int      `json:"version"`
	URL                   string   `json:"url"`
	Topics                []string `json:"topics"`
	CreatedAt             string   `json:"createdAt"`
	IsPrivate             bool     `json:"isPrivate"`
	IsArchived            bool     `json:"isArchived"`
	HasWiki               bool     `json:"hasWiki"`
	NumOfPRs              int      `json:"numOfPrs"`
	NumOfPRComments       int      `json:"numOfPrComments"`
	NumOfIssues           int      `json:"numOfIssues"`
	NumOfIssueComments    int      `json:"numOfIssueComments"`
	NumOfPRReviews        int      `json:"numOfPRReviews"`
	NumOfPRReviewComments int      `json:"numOfPRReviewComments"`
}

RepositoryTestOracle struct to hold a test oracle for a repository

type TestOracles

type TestOracles struct {
	RepositoryTestOracles   []RepositoryTestOracle   `json:",omitempty"`
	OrganizationTestOracles []OrganizationTestOracle `json:",omitempty"`
}

TestOracles struct to hold the tests from json files

Jump to

Keyboard shortcuts

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