Skip to content
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

Merged
merged 6 commits into from Feb 13, 2021
Merged

Add [Testspace] badges #6162

merged 6 commits into from Feb 13, 2021

Conversation

calebcartwright
Copy link
Member

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.)

@calebcartwright calebcartwright added the service-badge Accepted and actionable changes, features, and bugs label Feb 9, 2021
@shields-cd shields-cd temporarily deployed to shields-staging-pr-6162 February 9, 2021 02:28 Inactive
@shields-ci
Copy link

shields-ci commented Feb 9, 2021

Messages
📖 ✨ Thanks for your contribution to Shields, @calebcartwright!

Generated by 🚫 dangerJS against d7afdfc

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
Copy link
Member Author

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

Comment on lines +48 to +50
if (json.length === 0) {
throw new NotFound({ prettyMessage: 'space not found or results purged' })
}
Copy link
Member Author

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+',
Copy link
Member Author

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 /

@calebcartwright calebcartwright temporarily deployed to shields-staging-pr-6162 February 9, 2021 02:41 Inactive
@calebcartwright calebcartwright temporarily deployed to shields-staging-pr-6162 February 13, 2021 17:00 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Testspace Test Results Badges
4 participants