Skip to content

Commit

Permalink
chore: cleanup test docs
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright committed Apr 24, 2019
1 parent c4c14e8 commit 03cb2af
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
6 changes: 2 additions & 4 deletions services/jenkins/jenkins-build-redirect.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

const { redirector } = require('..')

const transformPath = ({ protocol, host, job }) =>
`/jenkins/build/${protocol}/${host}/${job}`

const commonProps = {
category: 'build',
transformPath,
transformPath: ({ protocol, host, job }) =>
`/jenkins/build/${protocol}/${host}/${job}`,
dateAdded: new Date('2019-04-20'),
}

Expand Down
7 changes: 2 additions & 5 deletions services/jenkins/jenkins-tests.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const Joi = require('joi')
const { InvalidResponse } = require('..')
const {
getDocumentation,
documentation,
testResultQueryParamSchema,
renderTestResultBadge,
} = require('../test-results')
Expand Down Expand Up @@ -77,10 +77,7 @@ module.exports = class JenkinsTests extends JenkinsBase {
total: 479,
isCompact: false,
}),
documentation: getDocumentation({
route:
'/jenkins/tests/https/jenkins.qa.ubuntu.com/view/Trusty/view/Smoke%20Testing/job/trusty-touch-flo-smoke-daily',
}),
documentation,
},
]
}
Expand Down
8 changes: 4 additions & 4 deletions services/test-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,21 @@ function renderTestResultBadge({
return { message, color }
}

const getDocumentation = ({ route }) => `
const documentation = `
<p>
You may change the "passed", "failed" and "skipped" text on this badge by supplying query parameters <code>&passed_label=</code>, <code>&failed_label=</code> and <code>&skipped_label=</code> respectively.
</p>
<p>
For example, if you want to use a different terminology:
<br>
<code>${route}.svg?passed_label=good&failed_label=bad&skipped_label=n%2Fa</code>
<code>?passed_label=good&failed_label=bad&skipped_label=n%2Fa</code>
</p>
<p>
Or symbols:
<br>
<code>${route}.svg?compact_message&passed_label=💃&failed_label=🤦‍♀️&skipped_label=🤷</code>
<code>?compact_message&passed_label=💃&failed_label=🤦‍♀️&skipped_label=🤷</code>
</p>
<p>
Expand All @@ -110,5 +110,5 @@ module.exports = {
testResultQueryParamSchema,
renderTestResultMessage,
renderTestResultBadge,
getDocumentation,
documentation,
}

0 comments on commit 03cb2af

Please sign in to comment.