Commit Graph

1652 Commits

Author SHA1 Message Date
George Hopkins
0fd69332bd Add Windows logo (#1467) 2018-01-24 09:54:51 +13:00
chris48s
ec38c2e4da [shippable] add tests for shippable service (#1362)
* add test suite to formalise existing behaviour of shippable service

* throw more descriprive errors, use es6 declarations

* switch from SVG parsing to shippable API

* add test case for unexpected status code

* remove unused import

* link to source for status codes
2018-01-22 19:28:59 -08:00
chris48s
3c551a6156 clarify default for Uptime Robot ratio (#1463)
Fix #1462
2018-01-21 18:01:31 -05:00
Danial
9aafe86247 Show logos by default on social badges (regression fix) (#1456)
* Show logos on social badges

* Revert "Showcase logos in social badges on the front page"

This reverts commit 61fa22b7e4.

* Update footer badges to all be social style

as per reverted commit 61fa22b7e4
2018-01-21 23:57:58 +01:00
chris48s
e3ac9c3db5 service tests for [itunes] (#1464) 2018-01-21 17:50:04 -05:00
Paul Melnikow
1d8926672c Fix PR metadata auth [cran] (#1454)
Match work done in #1453 to our CI setup.
2018-01-16 13:15:15 -05:00
chris48s
7c6723a79d service tests for [docker] (#1428) 2018-01-15 22:03:52 -05:00
Paul Melnikow
eacfc1497a For service tests, get PR metadata from Github API (#1453)
Rather than depend on Shields production, use the GitHub auth info from CI. It's disorienting to have our own CI go down when production is down. It also makes it harder to review PRs when there are ops issues.
2018-01-15 21:53:15 -05:00
Danial
65e1d69f53 [badge/dynamic/json] fix colorscheme on error (#1445)
* [FIX] error colorscheme

* throw error if jsonpath query non existent

* fixup

* show brightgreen badge by default

* update test

* let -> var

* set lightgrey when no uri specified

* update tests

* red color for no uri specified

* dynamic badge use setBadgecolor()
2018-01-16 13:53:30 +13:00
chris48s
e1f0e2598d tests for ruby [gem] service (#1444)
* add tests for ruby gems version badge

* add tests for ruby gems users badge

* add tests for ruby gems rank badge

* add tests for ruby gems downloads badges

* don't allow 0th rank

* move version info to left side of badge
2018-01-15 15:20:48 -05:00
Vladimir Starkov
a681fdaa87 Fix docker run (#1439)
* fix: update nodejs version to latest LTS, to fullfill check-node-version. close #1437

* docs: add docker run example without shields.env file, because there is no such file in a repo and container wont start

* fix: docker build project, clean npm and run production mode. close #1373
2018-01-15 15:19:28 -05:00
Paul Melnikow
6b26affb5f Uptime Robot: Use regex that accepts decimals (#1448)
For #1359

This failure from https://circleci.com/gh/badges/shields/1411?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

```
  26) Uptime Robot
       Uptime Robot: Percentage (valid)
         
  [ GET http://localhost:1111/uptimerobot/ratio/m778918918-3e92c097147760ee39d02d36.json ]:
     ValidationError: child "value" fails because ["value" with value "99.992%" fails to match the required pattern: /^[0-9]+%$/]
      at Object.exports.process (node_modules/joi/lib/errors.js:190:19)
      at internals.Object._validateWithOptions (node_modules/joi/lib/types/any/index.js:669:31)
      at module.exports.internals.Any.root.validate (node_modules/joi/lib/index.js:139:23)
      at Object.pathMatch.matchJSONTypes (node_modules/icedfrisby/lib/pathMatch.js:303:9)
      at node_modules/icedfrisby/lib/icedfrisby.js:703:10
      at IcedFrisbyNock._invokeExpects (node_modules/icedfrisby/lib/icedfrisby.js:1294:33)
      at start (node_modules/icedfrisby/lib/icedfrisby.js:1274:12)
      at Request.runCallback [as _callback] (node_modules/icedfrisby/lib/icedfrisby.js:1232:16)
      at Request.self.callback (node_modules/request/request.js:186:22)
      at Request.<anonymous> (node_modules/request/request.js:1163:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1085:12)
      at endReadableNT (_stream_readable.js:1056:12)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)
      at process._tickDomainCallback (internal/process/next_tick.js:218:9)

  27) Uptime Robot
       Uptime Robot: Percentage (valid, with numberOfDays param)
         
  [ GET http://localhost:1111/uptimerobot/ratio/7/m778918918-3e92c097147760ee39d02d36.json ]:
     ValidationError: child "value" fails because ["value" with value "99.967%" fails to match the required pattern: /^[0-9]+%$/]
      at Object.exports.process (node_modules/joi/lib/errors.js:190:19)
      at internals.Object._validateWithOptions (node_modules/joi/lib/types/any/index.js:669:31)
      at module.exports.internals.Any.root.validate (node_modules/joi/lib/index.js:139:23)
      at Object.pathMatch.matchJSONTypes (node_modules/icedfrisby/lib/pathMatch.js:303:9)
      at node_modules/icedfrisby/lib/icedfrisby.js:703:10
      at IcedFrisbyNock._invokeExpects (node_modules/icedfrisby/lib/icedfrisby.js:1294:33)
      at start (node_modules/icedfrisby/lib/icedfrisby.js:1274:12)
      at Request.runCallback [as _callback] (node_modules/icedfrisby/lib/icedfrisby.js:1232:16)
      at Request.self.callback (node_modules/request/request.js:186:22)
      at Request.<anonymous> (node_modules/request/request.js:1163:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1085:12)
      at endReadableNT (_stream_readable.js:1056:12)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)
      at process._tickDomainCallback (internal/process/next_tick.js:218:9)
```
2018-01-15 15:15:23 -05:00
Paul Melnikow
e358ebe6b3 Refactor LRU cache test asserts (#1418) 2018-01-15 14:15:27 -05:00
greenkeeper[bot]
b422e880c1 Update prettier to the latest version 🚀 (#1434) 2018-01-15 14:14:08 -05:00
Paul Melnikow
606946f24a Log + fail tests on unhandled promise rejections (#1424) 2018-01-14 16:57:40 -05:00
chris48s
be3bc45d66 service tests for [homebrew] (#1443)
* add tests and 'not found' handling for homebrew service

* add test with mocked response
2018-01-14 16:51:24 -05:00
Thaddee Tyl
09a2ca144d Tweak IP and badge type rate limits 2018-01-13 18:34:48 +01:00
Thaddee Tyl
61fa22b7e4 Showcase logos in social badges on the front page 2018-01-13 15:33:41 +01:00
Vladimir Starkov
db39093fa7 fix: add missing git to apk installation script. close #1435 (#1436) 2018-01-11 16:55:33 -05:00
Paul Melnikow
864b194e5c Add Joi to greenkeeper ignore (#1430) 2018-01-09 11:50:43 -05:00
Thaddee Tyl
ac8935cecb Add rate limiting
We now rate limit IPs, referers and badge type.
2018-01-09 02:35:51 +01:00
Thaddee Tyl
0da212b7de Upgrade to camp 17.2.1 2018-01-09 01:25:10 +01:00
Paul Melnikow
7c1a3fef69 Adopt Chai for assertions (#1419) 2018-01-08 14:18:07 -07:00
chris48s
2de53ce7bd add tests for [hackage] (#1416)
* add tests for hackage, handle 'not found'

* add 'not found' case for hackage-deps

* use es6 declarations

* change badge label to 'dependencies'
2018-01-06 22:02:34 -07:00
Michael
a55ab15de2 fix inline image path (#1427) 2018-01-06 08:44:11 -07:00
greenkeeper[bot]
2013968990 Update danger to the latest version 🚀 (#1414) 2018-01-05 22:09:25 -07:00
chris48s
e614d19355 service tests for [uptimerobot] (#1426)
* use the same error handling on /status and /ratio endpoints

* add service tests for uptime robot
2018-01-05 20:51:05 -07:00
Daniel Lo Nigro
02683afd04 Don't crash when logo passed as integer (#1319) 2018-01-04 17:11:59 -07:00
chris48s
e91c9fc7ab Add tests for Circle-CI (#1421) 2018-01-05 12:16:25 +13:00
Paul Melnikow
ccb3eb8fdf Fix January unit test (#1417) 2018-01-03 20:37:35 -07:00
chris48s
9cb9d5984d [requires] add tests for requires.io service, review error handling (#1361) 2018-01-02 20:13:10 -07:00
Danial
503618443e Add Discord logo (#1413) 2018-01-03 10:09:01 +13:00
Sebastian Staudt
e62c085922 Update URL for Homebrew formula versions (#1408)
braumeister.org is now part of Homebrew and available at formulae.brew.sh.
2018-01-01 17:40:05 -05:00
chris48s
e2ee997f07 service tests for [clojars] (#1410) 2018-01-01 17:15:55 -05:00
chris48s
21b1ad73e7 Service tests for [cdnjs] (#1409) 2018-01-01 17:14:16 -05:00
chris48s
438e47adfb Add tests for codeship service (#1411) 2018-01-01 17:10:02 -05:00
Paul Melnikow
60959bf7e7 Use github auth in php-v badges (#1403)
To fix service test that fails in CI (due to no github auth) https://github.com/badges/shields/issues/1359#issuecomment-354184074

- DRY getPhpReleases()
- Pass named options to regularUpdate
    - Add json option
- php-version: Move helpers before functions, and move exports to end
2017-12-28 21:30:30 -05:00
Paul Melnikow
84c60c8730 Optimization + cleanup in makeBadge (#1405)
- Avoid mutating the inputs
- Declare all the input and output keys
- Avoid recomputing escapeXml on the same values
- Capitalize social badge labels before measuring
2017-12-28 21:28:47 -05:00
Danial
3281005c26 Add [twitter] tests (#1394)
* twitter | add error text

inaccessable = 404 etc
invalid user = no data returned from endpoint
invalid = error thrown

* Twitter add tests

* add test for twitter url badge
2017-12-29 09:54:08 +13:00
Paul Melnikow
09cf211786 Fix tests for [suggest] endpoint (#1398) 2017-12-28 14:21:16 -05:00
Peter Gribanov
f719705518 Get tested PHP version from PHP-Eye (#1372) 2017-12-28 13:44:50 -05:00
Paul Melnikow
cc9a6db853 Speed up font-width computation in most cases (#1390)
Ref: #1379

This takes a naive approach to font-width computation, the most compute-intensive part of rendering badges.

1. Add the widths of the individual characters.
    - These widths are measured on startup using PDFKit.
2. For each character pair, add a kerning adjustment
    - The difference between the width of each character pair, and the sum of the characters' separate widths.
    - These are computed for each character pair on startup using PDFKit.
3. For a string with characters outside the printable ASCII character set, fall back to PDFKit.

This branch averaged 0.041 ms in `makeBadge`, compared to 0.144 ms on master, a speedup of 73%. That was on a test of 10,000 consecutive requests (using the `benchmark-performance.sh` script, now checked in).

The speedup applies to badges containing exclusively printable ASCII characters. It wouldn't be as dramatic on non-ASCII text. Though, we could add some frequently used non-ASCII characters to the cached set.
2017-12-26 23:57:46 -05:00
Paul Melnikow
105e383d93 Improve search performance (#1393)
Add a class which applies display: none to badges we don’t want to see. This is accomplished by passing a `shouldDisplay` function along with each badge, which pulls the current query through a closure and applies it.

A bit roundabout, but it works.

The rest of the changes are refactors to avoid code duplication.

I decreased the debouce rate to 50, which seems to work well.

Fix #1314
2017-12-26 23:53:15 -05:00
Paul Melnikow
0a2a80415c Increase the timeout on a test that often runs out of time (#1392)
e.g. #1391
2017-12-26 16:24:14 -05:00
Paul Melnikow
46a05e42b8 Add list of critical services (#1386)
I have a branch going to automatically generate stats on which services have tests, and make a line chart over time. I'm having a lot of fun with that so I'll keep at it.

Meanwhile, here is my subjective list of critical services, for #1358.
2017-12-25 22:21:37 -05:00
Pravdomil
e4fed8d178 Copyedit and add link in footer (#1366) 2017-12-21 18:34:48 -05:00
Danial
b48091a198 [FIX] Bower service tests (#1383) 2017-12-22 12:02:04 +13:00
Paul Melnikow
78bb20dc6a Danger: badge examples are not lib/ + wordsmith (#1381) 2017-12-20 21:11:59 -05:00
Zhmayev Yaroslav
2f9307ae2c Add Scrutinizer CI logo (#1380) 2017-12-21 11:24:11 +13:00
Marcin Mielnicki
cc84240b61 Prettier updated to 1.9.2 in package-lock (#1375) 2017-12-19 13:26:44 -05:00