tests/thirdparty: add skip option (#228)

Add the ability to skip third-party tests by specifying a known issue.
This commit is contained in:
Michael McLoughlin
2021-11-10 18:44:28 -08:00
committed by GitHub
parent 6c0ed1c4e8
commit 2867bd7e01
7 changed files with 157 additions and 0 deletions

View File

@@ -68,6 +68,24 @@ func (c *Client) Repository(ctx context.Context, owner, name string) (*Repositor
return repo, nil
}
// Issue gets information about the given Github issue.
func (c *Client) Issue(ctx context.Context, owner, name string, number int) (*Issue, error) {
// Build request.
u := fmt.Sprintf("%s/repos/%s/%s/issues/%d", c.base, owner, name, number)
req, err := http.NewRequestWithContext(ctx, http.MethodGet, u, nil)
if err != nil {
return nil, err
}
// Execute.
issue := &Issue{}
if err := c.request(req, issue); err != nil {
return nil, err
}
return issue, nil
}
func (c *Client) request(req *http.Request, payload interface{}) (err error) {
// Add common headers.
if c.token != "" {