-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add [Testspace] badges #6162
Add [Testspace] badges #6162
Conversation
|
async fetch({ org, project, space }) { | ||
// https://help.testspace.com/docs/reference/web-api#list-results | ||
const url = `https://${org}.testspace.com/api/projects/${encodeURIComponent( | ||
project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Project names by default seem to follow the org-name:repo-name
pattern so think encoding here is necessary
if (json.length === 0) { | ||
throw new NotFound({ prettyMessage: 'space not found or results purged' }) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces can either be specified by a branch name, or an integer id. I'm not sure how likely this would be in practice, but I ran into it after I'd saved a link (which default to the integer id) for a PR run
static route = { | ||
base: 'testspace', | ||
pattern: | ||
':metric(total|passed|failed|skipped|errored)/:org/:project/:space+', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space will often be specified with a branch name, and of course branches in source repos can have /
b5d0fb9
to
593a6ac
Compare
Resolves #6077
Opted to pull the common bits into a separate base class and define the badge classes in separate file to get shorter files and slightly simpler tests, but otherwise very similar to our other test result related badge friends (Sonar, AppVeyor, Azure DevOps, Jenkins, etc.)