separate general e2e test from apis.guru

This commit is contained in:
Roman Hotsiy 2016-05-10 10:03:04 +03:00
parent 50a378f3ea
commit b2db144c6b
3 changed files with 34 additions and 31 deletions

View File

@ -7,9 +7,10 @@ branches:
matrix: matrix:
include: include:
- env: JOB=e2e - env: JOB=e2e
- env: JOB=e2e-guru
fast_finish: true fast_finish: true
allow_failures: allow_failures:
- env: JOB=e2e - env: JOB=e2e-guru
env: env:
global: global:
- GH_REF: github.com/Rebilly/ReDoc.git - GH_REF: github.com/Rebilly/ReDoc.git
@ -41,16 +42,16 @@ deploy:
secure: PuhWLERrCEFmXmdFpw2OVFlqpOIVDmgwk5JUJOYaFdVCh/smp0+jZCQ4vrdFpuG96rnDVirD+A8xvW6NgsNNaRthLgOB/LRdFN69rU6Gvn3At6wlnC55t5dlhxPvCfnzJcHVBLXX4EmMkjnZqDg2uczXTzPodr3FnQJNuXmP8B33fzDVLyHccvXZ90abwXWVrgRIXPU28niqCR8DOC2OTzs7wqz+BLNkYDRRbyYXsg62HWuD33x5iof5IqBmhzBt3usCGmF3QGcgHrXHdZw3sZnit8+Bua++3KrXR0x6HGXXN1AoXVmCAkCa5OTQ5R3tCRxiJN3P2KLnvWeZR74sTFkovJB/6pGCvbJ/c7Wnuw6sD7SgOUBD359ULB6lAf5OnxBLoNebX4JxxVXF+zA4E3Bl44VxkzDpPWc15xqBPMB5vBREzMVmJ5mExn2s5cmLQjADbl9h0y6gZnhnNJ+iTmqtrVyM0ZkF2rPrzrTdGD+ULmRIlTMkdD1bh+/TJ3RdXT3P4/zNUJmiNnvgnnJVYYvsGaXWF+7uCVHT/8k2RsoSHqgkqh0gkDqGSwVix55y5mC7T2Vk9lMBhm6MvFJXaonOX0kxJS4EDQ3plPd6/ybG+TLhwggYnQ8o9msU5Nt6FpUShKiezjKurIhbQZdwlVivX3tahjW2QjNDO58xGgY= secure: PuhWLERrCEFmXmdFpw2OVFlqpOIVDmgwk5JUJOYaFdVCh/smp0+jZCQ4vrdFpuG96rnDVirD+A8xvW6NgsNNaRthLgOB/LRdFN69rU6Gvn3At6wlnC55t5dlhxPvCfnzJcHVBLXX4EmMkjnZqDg2uczXTzPodr3FnQJNuXmP8B33fzDVLyHccvXZ90abwXWVrgRIXPU28niqCR8DOC2OTzs7wqz+BLNkYDRRbyYXsg62HWuD33x5iof5IqBmhzBt3usCGmF3QGcgHrXHdZw3sZnit8+Bua++3KrXR0x6HGXXN1AoXVmCAkCa5OTQ5R3tCRxiJN3P2KLnvWeZR74sTFkovJB/6pGCvbJ/c7Wnuw6sD7SgOUBD359ULB6lAf5OnxBLoNebX4JxxVXF+zA4E3Bl44VxkzDpPWc15xqBPMB5vBREzMVmJ5mExn2s5cmLQjADbl9h0y6gZnhnNJ+iTmqtrVyM0ZkF2rPrzrTdGD+ULmRIlTMkdD1bh+/TJ3RdXT3P4/zNUJmiNnvgnnJVYYvsGaXWF+7uCVHT/8k2RsoSHqgkqh0gkDqGSwVix55y5mC7T2Vk9lMBhm6MvFJXaonOX0kxJS4EDQ3plPd6/ybG+TLhwggYnQ8o9msU5Nt6FpUShKiezjKurIhbQZdwlVivX3tahjW2QjNDO58xGgY=
on: on:
tags: true tags: true
condition: $JOB != e2e condition: $JOB == e2e
- skip_cleanup: true - skip_cleanup: true
provider: script provider: script
script: npm run branch-release script: npm run branch-release
on: on:
branch: master branch: master
condition: $JOB != e2e condition: $JOB == e2e
- skip_cleanup: true - skip_cleanup: true
provider: script provider: script
script: npm run deploy script: npm run deploy
on: on:
tags: true tags: true
condition: $JOB != e2e condition: $JOB == e2e

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
if [ "$JOB" = "e2e" ]; then if [ "$JOB" = "e2e" ] || [ "$JOB" = "e2e-guru" ]; then
npm run e2e npm run e2e
else else
npm run unit npm run unit

View File

@ -51,34 +51,36 @@ describe('Scroll sync', () => {
}); });
}); });
describe('APIs.guru specs test', ()=> { if (process.env.JOB === 'e2e-guru') {
describe('APIs.guru specs test', ()=> {
// global.apisGuruList was loaded in onPrepare method of protractor config // global.apisGuruList was loaded in onPrepare method of protractor config
let apisGuruList = global.apisGuruList; let apisGuruList = global.apisGuruList;
// Remove certain APIs that are known to cause problems // Remove certain APIs that are known to cause problems
delete apisGuruList['motaword.com']; // invalid (see https://github.com/BigstickCarpet/swagger-parser/issues/26) delete apisGuruList['motaword.com']; // invalid (see https://github.com/BigstickCarpet/swagger-parser/issues/26)
delete apisGuruList['learnifier.com']; // allof object and no type delete apisGuruList['learnifier.com']; // allof object and no type
delete apisGuruList['googleapis.com:mirror']; // bad urls in images delete apisGuruList['googleapis.com:mirror']; // bad urls in images
delete apisGuruList['googleapis.com:discovery']; // non-string references delete apisGuruList['googleapis.com:discovery']; // non-string references
delete apisGuruList['clarify.io']; // non-string references delete apisGuruList['clarify.io']; // non-string references
delete apisGuruList['pushpay.com']; // https://github.com/Rebilly/ReDoc/issues/30 delete apisGuruList['pushpay.com']; // https://github.com/Rebilly/ReDoc/issues/30
// run quick version of e2e test on all builds except releases // run quick version of e2e test on all builds except releases
if (process.env.TRAVIS && !process.env.TRAVIS_TAG) { if (process.env.TRAVIS && !process.env.TRAVIS_TAG) {
console.log('Running on short APIs guru list'); console.log('Running on short APIs guru list');
apisGuruList = eachNth(apisGuruList, 10); apisGuruList = eachNth(apisGuruList, 10);
} else { } else {
console.log('Running on full APIs guru list') console.log('Running on full APIs guru list')
} }
for (let apiName of Object.keys(apisGuruList)) { for (let apiName of Object.keys(apisGuruList)) {
let apiInfo = apisGuruList[apiName].versions[apisGuruList[apiName].preferred]; let apiInfo = apisGuruList[apiName].versions[apisGuruList[apiName].preferred];
let url = apiInfo.swaggerUrl; let url = apiInfo.swaggerUrl;
// temporary hack due to this issue: https://github.com/substack/https-browserify/issues/6 // temporary hack due to this issue: https://github.com/substack/https-browserify/issues/6
url = url.replace('https://', 'http://'); url = url.replace('https://', 'http://');
url = url.replace('apis-guru.github.io/', 'apis-guru.github.io:80/'); url = url.replace('apis-guru.github.io/', 'apis-guru.github.io:80/');
basicTests(url, `${apiName}:${apiInfo.info.version}\n${url}`); basicTests(url, `${apiName}:${apiInfo.info.version}\n${url}`);
} }
}); });
}